mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-09-21 21:51:34 +02:00
49 lines
1.0 KiB
Plaintext
49 lines
1.0 KiB
Plaintext
#!/sbin/openrc-run
|
|
description="A tool for service discovery, monitoring and configuration"
|
|
description_checkconfig="Verify configuration files"
|
|
description_healthcheck="Check health status"
|
|
description_reload="Reload configuration"
|
|
|
|
extra_commands="checkconfig"
|
|
extra_started_commands="healthcheck reload"
|
|
|
|
command="/usr/sbin/$RC_SVCNAME"
|
|
command_args="$consul_opts"
|
|
command_user="$RC_SVCNAME:$RC_SVCNAME"
|
|
|
|
supervisor=supervise-daemon
|
|
pidfile="/run/$RC_SVCNAME.pid"
|
|
output_log="/var/log/$RC_SVCNAME.log"
|
|
error_log="/var/log/$RC_SVCNAME.log"
|
|
umask=027
|
|
respawn_max=0
|
|
respawn_delay=10
|
|
healthcheck_timer=60
|
|
|
|
depend() {
|
|
need net
|
|
after firewall
|
|
}
|
|
|
|
checkconfig() {
|
|
ebegin "Checking /etc/consul"
|
|
$command validate /etc/consul
|
|
eend $?
|
|
}
|
|
|
|
start_pre() {
|
|
checkconfig
|
|
checkpath -f -m 0640 -o "$command_user" "$output_log" "$error_log"
|
|
}
|
|
|
|
healthcheck() {
|
|
$command config list -kind proxy-defaults
|
|
}
|
|
|
|
reload() {
|
|
start_pre \
|
|
&& ebegin "Reloading $RC_SVCNAME configuration" \
|
|
&& supervise-daemon "$RC_SVCNAME" --signal HUP --pidfile "$pidfile"
|
|
eend $?
|
|
}
|