mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-08-09 23:37:05 +02:00
67 lines
1.3 KiB
Plaintext
67 lines
1.3 KiB
Plaintext
#!/sbin/openrc-run
|
|
# Copyright 1999-2007 Gentoo Foundation
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
# $Header: /var/cvsroot/gentoo-x86/net-dns/pdns/files/pdns,v 1.10 2007/05/07 20:19:18 swegener Exp $
|
|
|
|
name=pdns
|
|
daemon=/usr/sbin/pdns_server
|
|
pdns_control=/usr/bin/pdns_control
|
|
|
|
extra_started_commands="dump reload"
|
|
extra_commands="monitor"
|
|
|
|
PDNS_INSTANCE="${SVCNAME#pdns[.-]}"
|
|
PDNS_CONFIG=""
|
|
|
|
if [ -n "${PDNS_INSTANCE}" ] && [ "${PDNS_INSTANCE}" != "pdns" ]
|
|
then
|
|
PDNS_CONFIG="--config-name=${PDNS_INSTANCE}"
|
|
else
|
|
PDNS_INSTANCE="default"
|
|
fi
|
|
|
|
depend() {
|
|
need net
|
|
after firewall
|
|
}
|
|
|
|
start() {
|
|
ebegin "Starting PowerDNS (${PDNS_INSTANCE})"
|
|
${daemon} \
|
|
${PDNS_CONFIG} \
|
|
--daemon=yes \
|
|
--guardian=yes
|
|
eend $?
|
|
}
|
|
|
|
stop() {
|
|
ebegin "Stopping PowerDNS (${PDNS_INSTANCE})"
|
|
${pdns_control} ${PDNS_CONFIG} quit &>/dev/null
|
|
eend $?
|
|
}
|
|
|
|
reload() {
|
|
ebegin "Reloading PowerDNS (${PDNS_INSTANCE})"
|
|
${pdns_control} ${PDNS_CONFIG} cycle &>/dev/null
|
|
eend $?
|
|
}
|
|
|
|
dump() {
|
|
ebegin "Dumping PowerDNS (${PDNS_INSTANCE}) variables"
|
|
${pdns_control} ${PDNS_CONFIG} list
|
|
eend $?
|
|
}
|
|
|
|
monitor() {
|
|
ebegin "Starting PowerDNS (${PDNS_INSTANCE}) in monitor mode"
|
|
${daemon} \
|
|
${PDNS_CONFIG} \
|
|
--daemon=no \
|
|
--guardian=no \
|
|
--control-console=yes \
|
|
--loglevel=9 \
|
|
--log-dns-details=yes \
|
|
--query-logging=yes
|
|
eend $?
|
|
}
|