aports/testing/minio/minio.initd
Chloe Kudryavtsev 9f74ea1677 testing/minio: allow infinite respawning
Minio will crash on startup if networking is not available.
A short period of the network dropping should not prevent the service
from coming up once networking is back.
As such, allow infinite respawns.
To avoid CPU thrashing, enforce a 5-second delay between respawns.
2019-06-10 15:12:03 +00:00

26 lines
688 B
Plaintext

#!/sbin/openrc-run
supervisor=supervise-daemon
respawn_delay=5
respawn_max=0
healthcheck_timer=30
name='Minio Block Storage Server'
command=/usr/bin/minio
command_args="server \
${address:+--address=$address} \
$MINIO_OPTS \
$MINIO_VOLUMES"
command_user="minio:minio"
start_pre() {
# the conf.d file might contain secrets!
[ -f "/etc/conf.d/${RC_SVCNAME}" ] && checkpath --file --mode 0600 --owner root:root "/etc/conf.d/${RC_SVCNAME}"
# make sure the default volume exists
checkpath --directory --mode 0700 --owner minio:minio "/srv/${RC_SVCNAME}"
}
healthcheck() {
[ -x /usr/bin/curl ] || return 0
/usr/bin/curl -q "$address"/minio/health/ready
}