aboutsummaryrefslogtreecommitdiffstats
path: root/testing/gdnsd/gdnsd.initd
blob: 7a4c2ee5f79e8c2c4fc90a59e9a608511d2260c3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/sbin/openrc-run

name="gdnsd daemon"
extra_commands="configtest"
extra_started_commands="reload fastrestart"
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)"


depend() {
	need net
	use logger
	after firewall
	provide auth-dns
}

act() {
	ebegin "$1 ${SVCNAME}"
	/usr/sbin/gdnsd $2
	eend $?
}

configtest() {
	act "Checking configuration" checkconf
}

start() {
	act "Starting" start
}

stop () {
	if [ "${RC_CMD}" = "restart" ]; then
		configtest || return 1
	fi
	act "Stopping" stop
}

restart() {
	act "Restarting" restart
}

reload-zones() {
	act "Reloading" reload-zones
}