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


                                                  
    

                               

  

                                
                               
                                                                                       
                        

                              

                                    




                      
          

                                                          



               

                                         

               
 
#!/sbin/openrc-run

extra_started_commands="dump reload"

instance_name="${RC_SVCNAME#pdns[.-]}"
if [ "$instance_name" != "$RC_SVCNAME" ]; then
	pdns_config="--config-name=$instance_name"
else
	pdns_config=""
	instance_name="default"
fi

name="PowerDNS ($instance_name)"

command="/usr/sbin/pdns_server"
command_args="${command_args:-} --guardian=yes --daemon=no --write-pid=no $pdns_config"
command_background="yes"
pidfile="/run/$RC_SVCNAME.pid"

pdns_control="/usr/bin/pdns_control"

depend() {
	need net
	after firewall
}

reload() {
	ebegin "Reloading $name"
	"$pdns_control" $pdns_config cycle >/dev/null 2>&1
	eend $?
}

dump() {
	ebegin "Dumping $name variables"
	"$pdns_control" $pdns_config list
	eend $?
}