implemented systemd script (#2167)

This commit is contained in:
Remco Verhoef 2016-07-11 12:55:40 +02:00 committed by Harshavardhana
parent de468f92ec
commit a162198623
2 changed files with 85 additions and 0 deletions

50
dist/linux-systemd/minio.service vendored Normal file
View File

@ -0,0 +1,50 @@
[Unit]
Description=Minio
Documentation=http://minio.io
Wants=network-online.target
After=network-online.target
AssertPathExists=/etc/minio/
AssertFileIsExecutable=/usr/share/minio/bin/minio
[Service]
WorkingDirectory=/usr/share/minio/
User=minio
Group=minio
PermissionsStartOnly=true
EnvironmentFile=-/etc/default/minio
ExecStartPre=/bin/bash -c "[ -n \"${MINIO_VOLUMES}\" ] || echo \"Variable MINIO_VOLUMES not set in /etc/defaults/minio\""
ExecStartPre=/bin/bash -c "(for i in $MINIO_VOLUMES; do if [ ! -d $i ]; then echo \"Directory $i of variable MINIO_VOLUMES isn't an existing directory\" && false; exit; fi; done)"
ExecStartPre=-/bin/chown -R root:minio /etc/minio/
ExecStartPre=-/bin/chmod -R 660 /etc/minio/
ExecStartPre=-/bin/chmod -R ug+X /etc/minio/
ExecStart=/usr/share/minio/bin/minio \
--config-dir "/etc/minio/" \
server \
$MINIO_OPTS \
$MINIO_VOLUMES
StandardOutput=journal
StandardError=inherit
# Specifies the maximum file descriptor number that can be opened by this process
LimitNOFILE=65536
# Disable timeout logic and wait until process is stopped
TimeoutStopSec=0
# SIGTERM signal is used to stop Minio
KillSignal=SIGTERM
SendSIGKILL=no
SuccessExitStatus=0
[Install]
WantedBy=multi-user.target
# Built for ${project.name}-${project.version} (${project.name})

35
dist/linux-systemd/readme.md vendored Normal file
View File

@ -0,0 +1,35 @@
# Readme
Service script for minio service for systemd.
# Installation
```
mkdir /etc/minio/
mkdir -p /usr/share/minio/bin/
wget -o /usr/share/minio/bin/minio http://...
```
Create minio user.
```
useradd minio
```
Create default configuration. Don't forget to update MINIO_VOLUMES with the correct path(s).
```
cat <<EOT >> /etc/default/minio
MINIO_OPTS="--address :9000"
MINIO_VOLUMES="/tmp/minio/"
EOT
```
# Systemctl
Put minio.service in /etc/systemd/system/
```
curl https://raw.githubusercontent.com/minio/minio/master/dist/linux-systemd/minio.service > /etc/systemd/system/
```
Enable startup on boot
```
systemctl enable minio.service
```