1
0
Fork 0
mirror of https://gitlab.alpinelinux.org/alpine/aports.git synced 2025-07-19 17:25:17 +03:00
aports/testing/minio/minio.initd
Chloe Kudryavtsev c885a7a604
testing/minio: upgrade to 0.20190619
Also improve healthcheck.
When conf.d does not define an `$address`, curl will try to query a file
(`/minio/health/ready`), which obviously will always fail.
By default, minio will listen on 0.0.0.0:9000, so default to localhost.

Closes: GH-8911
2019-06-20 00:44:00 +02:00

25 lines
706 B
Text

#!/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:-localhost:9000}"/minio/health/ready
}