diff options
Diffstat (limited to 'net-dns/mydns/files/mydns.initd')
-rw-r--r-- | net-dns/mydns/files/mydns.initd | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/net-dns/mydns/files/mydns.initd b/net-dns/mydns/files/mydns.initd new file mode 100644 index 000000000000..d78d1df91cb0 --- /dev/null +++ b/net-dns/mydns/files/mydns.initd @@ -0,0 +1,35 @@ +#!/sbin/openrc-run +# Copyright 1999-2016 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +MYDNS_CHECKCONF="/usr/bin/mydnscheck" +MYDNS_CONFFILE="${MYDNS_CONFFILE:-/etc/mydns.conf}" + +command="/usr/sbin/mydns" +command_args="--background --conf=${MYDNS_CONFFILE} ${MYDNS_EXTRA_OPTS}" +extra_commands="configtest" +extra_started_commands="reload" +pidfile="$(grep '^pidfile' ${MYDNS_CONFFILE} | sed -e 's/^pidfile\s*=\s*\([^# ]\+\?\)\s*\(#.*\)\?$/\1/')" +pidfile="${pidfile:-/var/run/mydns.pid}" + +depend() { + need net + use logger mysql postgresql +} + +checkconfig() { + "${MYDNS_CHECKCONF}" --conf="${MYDNS_CONFFILE}" + return $? +} + +configtest() { + ebegin "Checking ${SVCNAME} configuration" + checkconfig + eend $? +} + +reload() { + ebegin "Reloading ${SVCNAME}" + start-stop-daemon --signal HUP --pidfile "${pidfile}" + eend $? +} |