aboutsummaryrefslogtreecommitdiffstats
path: root/community/gdnsd/gdnsd.initd
diff options
context:
space:
mode:
Diffstat (limited to 'community/gdnsd/gdnsd.initd')
-rwxr-xr-xcommunity/gdnsd/gdnsd.initd50
1 files changed, 16 insertions, 34 deletions
diff --git a/community/gdnsd/gdnsd.initd b/community/gdnsd/gdnsd.initd
index e8a75e846b8..fc9028cebde 100755
--- a/community/gdnsd/gdnsd.initd
+++ b/community/gdnsd/gdnsd.initd
@@ -1,20 +1,15 @@
#!/sbin/openrc-run
name="gdnsd daemon"
-extra_commands="configtest"
-extra_started_commands="reload fastrestart"
+extra_commands="checkconf"
+extra_started_commands="reload"
description="Geographic Authoritative DNS server"
-description_configtest="Run syntax tests for configuration files only."
-description_reload="Signal running gdnsd to reload configuration files"
-description_fastrestart="Optimized restart sequence (minimizes down time)"
-
-if [ -z "${GDNSD_CONFFILE}" ]; then
- if [ "${SVCNAME}" = "gdnsd" ]; then
- GDNSD_ROOT=system
- else
- GDNSD_ROOT=/var/gdnsd/${SVCNAME}
- fi
-fi
+description_configtest="Run syntax tests for configuration files only"
+description_reload="Reload zone data"
+command_background=true
+pidfile=/var/run/${RC_SVCNAME}.pid
+command="/usr/sbin/gdnsd"
+command_args="start"
depend() {
need net
@@ -23,31 +18,18 @@ depend() {
provide auth-dns
}
-act() {
- ebegin "$1 ${SVCNAME}"
- /usr/sbin/gdnsd -d ${GDNSD_ROOT} $2
+checkconf() {
+ ebegin "Checking configuration of ${RC_SVCNAME}"
+ gdnsd checkconf
eend $?
}
-configtest() {
- act "Checking configuration" checkconf
-}
-
-start() {
- act "Starting" start
-}
-
-stop () {
- if [ "${RC_CMD}" = "restart" ]; then
- configtest || return 1
- fi
- act "Stopping" stop
-}
-
-fastrestart() {
- act "Restarting" restart
+stop_pre() {
+ checkconf
}
reload() {
- act "Reloading" reload
+ ebegin "Reloading ${RC_SVCNAME} zone data"
+ gdnsdctl reload-zones
+ eend $?
}