2018-06-25 16:30:17 +02:00
|
|
|
# {{ ansible_managed }}
|
|
|
|
|
2017-01-02 17:52:58 +01:00
|
|
|
[Unit]
|
|
|
|
Description=Minio
|
|
|
|
Documentation=https://docs.minio.io
|
|
|
|
Wants=network-online.target
|
|
|
|
After=network-online.target
|
|
|
|
AssertFileIsExecutable={{ minio_server_bin }}
|
|
|
|
|
|
|
|
[Service]
|
|
|
|
WorkingDirectory=/usr/local/
|
|
|
|
|
|
|
|
User={{ minio_user }}
|
|
|
|
Group={{ minio_group }}
|
|
|
|
|
|
|
|
PermissionsStartOnly=true
|
|
|
|
|
|
|
|
EnvironmentFile={{ minio_server_envfile }}
|
|
|
|
ExecStartPre=/bin/bash -c "[ -n \"${MINIO_VOLUMES}\" ] || echo \"Variable MINIO_VOLUMES not set in {{ minio_server_envfile }}\""
|
2018-06-25 16:30:17 +02:00
|
|
|
|
2017-01-02 17:52:58 +01:00
|
|
|
ExecStart={{ minio_server_bin }} server $MINIO_OPTS $MINIO_VOLUMES
|
|
|
|
|
2018-06-25 16:30:17 +02:00
|
|
|
# Let systemd restart this service only if it has ended with the clean exit code or signal.
|
|
|
|
Restart=on-success
|
|
|
|
|
2017-01-02 17:52:58 +01:00
|
|
|
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
|
|
|
|
|
2018-06-25 22:53:37 +02:00
|
|
|
{% if (minio_server_addr.split(':')[-1] | int) < 1024 %}
|
2018-06-25 16:30:17 +02:00
|
|
|
AmbientCapabilities=CAP_NET_BIND_SERVICE
|
|
|
|
{% endif %}
|
|
|
|
|
2017-01-02 17:52:58 +01:00
|
|
|
[Install]
|
|
|
|
WantedBy=multi-user.target
|