Package bind: Скрипты

Post install

SYSLOGD_SCRIPT=/etc/init.d/syslogd
SYSLOGD_CONFIG=/etc/sysconfig/syslogd
if grep -qs '^SYSLOGD_OPTIONS=.*-a /var/lib/bind/dev/log' "$SYSLOGD_CONFIG"; then
	# Remove artefacts of pre-syslog.d epoch.
	sed -i 's|^\(SYSLOGD_OPTIONS=.*\) \?-a /var/lib/bind/dev/log|\1|' "$SYSLOGD_CONFIG"
	if [ -x "$SYSLOGD_SCRIPT" ]; then
		"$SYSLOGD_SCRIPT" condreload ||:
	fi
fi


if [ $1 -ge 2 ]; then 
	/usr/sbin/control-restore bind-chroot 
else 
	for facility in bind-chroot; do 
		/usr/sbin/control "$facility" enabled 
	done 
fi 


if [ $1 -ge 2 ]; then 
	/usr/sbin/control-restore bind-debug bind-slave bind-caps 
else 
	for facility in bind-debug bind-slave bind-caps; do 
		/usr/sbin/control "$facility" disabled 
	done 
fi 


# next section is the copy of post_service, but
# it doesn't restart named since this is responsibility of filetrigger
SYSTEMCTL=systemctl
if sd_booted && "$SYSTEMCTL" --version >/dev/null 2>&1; then
    "$SYSTEMCTL" daemon-reload
    if [ "$1" -eq 1 ]; then
        "$SYSTEMCTL" -q preset bind
    fi
else
    if [ "$1" -eq 1 ]; then
        chkconfig --add bind
    else
        chkconfig bind resetpriorities
    fi
fi
Pre install

/usr/sbin/groupadd -r -f named
/usr/sbin/useradd -r -g named -d /var/lib/bind -s /dev/null -n \
    -c "Domain Name Server" named >/dev/null 2>&1 ||:
[ -f /etc/rc.d/init.d/named -a ! -L /etc/rc.d/init.d/named ] && /sbin/chkconfig --del named ||:

# save running status and use it in post-transaction
rm -f '/run/named/named.restart'

if [ "$1" -gt 1 ]; then
    SYSTEMCTL=systemctl
    if sd_booted && "$SYSTEMCTL" --version >/dev/null 2>&1; then
        "$SYSTEMCTL" is-active bind.service >/dev/null 2>&1 &&
        "$SYSTEMCTL" stop bind.service 2>/dev/null &&
        mkdir -p "$(dirname '/run/named/named.restart')" &&
        touch '/run/named/named.restart' 2>/dev/null ||:
    else
        /etc/rc.d/init.d/bind status >/dev/null 2>&1 &&
        /etc/rc.d/init.d/bind stop 2>/dev/null &&
        mkdir -p "$(dirname '/run/named/named.restart')" &&
        touch '/run/named/named.restart' 2>/dev/null ||:
    fi
fi


if [ $1 -ge 2 ]; then 
	/usr/sbin/control-dump bind-chroot bind-debug bind-slave bind-caps 
fi
Pre uninstall

/usr/sbin/preun_service bind