aboutsummaryrefslogblamecommitdiffstats
path: root/community/gdnsd/gdnsd.initd
blob: e8a75e846b86dabda078f9c6b767382e767603bf (plain) (tree)
1
2
3
4
5
6
7
8
9
                  
 

                           

                                                 
                                                                       

                                                                          


                                           
                                 
            
                                                


          

                
                  
                      
                        

 

                              
                                           


               



                                              



                            
         


                                            


                           

                                

 

                              
 
#!/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)"

if [ -z "${GDNSD_CONFFILE}" ]; then
	if [ "${SVCNAME}" = "gdnsd" ]; then
		GDNSD_ROOT=system
	else
		GDNSD_ROOT=/var/gdnsd/${SVCNAME}
	fi
fi

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

act() {
	ebegin "$1 ${SVCNAME}"
	/usr/sbin/gdnsd -d ${GDNSD_ROOT} $2
	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
}

reload() {
	act "Reloading" reload
}