5
0
mirror of https://github.com/cwinfo/yggdrasil-go.git synced 2024-11-21 20:40:28 +00:00

contrib/openrc: add reload command

This commit is contained in:
William Wennerström 2019-03-05 20:50:24 +01:00
parent 26a952aa6c
commit 1097c1c0c9
No known key found for this signature in database
GPG Key ID: E1382990BEDD319B

View File

@ -6,6 +6,7 @@ CONFFILE="/etc/yggdrasil.conf"
pidfile="/run/${RC_SVCNAME}.pid"
command="/usr/bin/yggdrasil"
extra_started_commands="reload"
depend() {
use net dns logger
@ -31,19 +32,25 @@ start_pre() {
}
start() {
ebegin "Starting Yggdrasil"
ebegin "Starting ${RC_SVCNAME}"
start-stop-daemon --start --quiet \
--pidfile "${pidfile}" \
--make-pidfile \
--background \
--stdout /var/log/yggdrasil.stdout.log \
--stderr /var/log/yggdrasil.stderr.log \
--exec "${command}" -- -useconf < "${CONFFILE}"
--exec "${command}" -- -useconffile "${CONFFILE}"
eend $?
}
reload() {
ebegin "Reloading ${RC_SVCNAME}"
start-stop-daemon --signal HUP --pidfile "${pidfile}"
eend $?
}
stop() {
ebegin "Stopping Yggdrasil"
ebegin "Stopping ${RC_SVCNAME}"
start-stop-daemon --stop --pidfile "${pidfile}" --exec "${command}"
eend $?
}