mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-08-26 08:51:25 +02:00
According with https://www.consul.io/docs/commands/validate.html the checkconfig in the init.d script should have been fixed.
45 lines
1.1 KiB
Plaintext
45 lines
1.1 KiB
Plaintext
#!/sbin/openrc-run
|
|
CONSUL_LOG_FILE="/var/log/${SVCNAME}.log"
|
|
|
|
name=consul
|
|
description="A tool for service discovery, monitoring and configuration"
|
|
description_checkconfig="Verify configuration file"
|
|
daemon=/usr/sbin/$name
|
|
daemon_user=$name
|
|
daemon_group=$name
|
|
extra_commands="checkconfig"
|
|
|
|
start_pre() {
|
|
checkpath -f -m 0644 -o ${SVCNAME}:${SVCNAME} "$CONSUL_LOG_FILE"
|
|
}
|
|
|
|
depend() {
|
|
need net
|
|
after firewall
|
|
}
|
|
|
|
checkconfig() {
|
|
consul validate /etc/consul
|
|
}
|
|
|
|
start() {
|
|
checkconfig || return 1
|
|
|
|
ebegin "Starting ${name}"
|
|
start-stop-daemon --start --quiet \
|
|
-m --pidfile /var/run/${name}.pid \
|
|
--user ${daemon_user} --group ${daemon_group} \
|
|
-b --stdout $CONSUL_LOG_FILE --stderr $CONSUL_LOG_FILE \
|
|
-k 027 --exec ${daemon} -- ${consul_opts}
|
|
eend $?
|
|
}
|
|
|
|
stop() {
|
|
ebegin "Stopping ${name}"
|
|
start-stop-daemon --stop --quiet \
|
|
--pidfile /var/run/${name}.pid \
|
|
--exec ${daemon}
|
|
eend $?
|
|
}
|
|
|