aports/testing/minio/minio.initd
Chloe Kudryavtsev 3cfa6527b7 testing/minio: modernize init.d
Now that we have openrc 0.41.2, supervise-daemon is actually usable.
Minio also behaves much nicer with it.
2019-05-10 04:54:34 +00:00

24 lines
658 B
Plaintext

#!/sbin/openrc-run
supervisor=supervise-daemon
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
}