Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > by-pkgid > f52f5fb7aefdbb53d224312f93e4db1f > scriptlet

bind-9.3.6-25.P1.el5_11.9.x86_64.rpm

PREIN

/bin/sh
if [ "$1" -eq 1 ]; then
   /usr/sbin/groupadd -g 25 -f -r named >/dev/null 2>&1 || :;
   /usr/sbin/useradd  -u 25 -r -n -M -g named -s /sbin/nologin -d /var/named -c Named named >/dev/null 2>&1 || :;
fi;
:;

PREUN

/bin/sh
if [ "$1" = 0 ]; then
   /sbin/service named stop >/dev/null 2>&1 || :;
   /sbin/chkconfig --del named || :;
fi
:;

POSTIN

/bin/sh
/sbin/ldconfig
/sbin/chkconfig --add named
if [ "$1" -eq 1 ]; then
	# no more named.boot autoconversion! No-one should be using BIND-4 anymore.
	if [ ! -e /etc/rndc.key ]; then
	# create the rndc.key file:
	   echo 'key "rndckey" {
	algorithm	hmac-md5;
	secret		"'`/usr/sbin/dns-keygen`'";
};'  >     /etc/rndc.key;
	elif /bin/egrep -q '@KEY@' /etc/rndc.key; then
	   # fix potential problem with older versions
	   /bin/sed -i -e 's^@KEY@^'`/usr/sbin/dns-keygen`'^' /etc/rndc.key ;
	fi
        [ -e /selinux/enforce ] && [ -x /sbin/restorecon ] && /sbin/restorecon /etc/rndc.* /etc/named.* >/dev/null 2>&1 ;
        # rndc.key has to have correct perms and ownership, CVE-2007-6283
	[ -e /etc/rndc.key ] && chown root:named /etc/rndc.key
	[ -e /etc/rndc.key ] && chmod 0640 /etc/rndc.key
fi
:;

POSTUN

/bin/sh
/sbin/ldconfig
if [ "$1" -ge 1 ]; then
   /sbin/service named condrestart >/dev/null 2>&1 || :;
fi;
:;

Triggers

bind < 8.2.2_P5-15

/bin/sh
/sbin/chkconfig --add named
/sbin/ldconfig
:;

bind <= 24:9.3.1-11

/bin/sh
if [ "$1" -gt 0 ]; then
# bind <= 22:9.3.0-2:
# These versions of bind installed named service at order 55 in
# runlevel startup order, after programs like  nis / ntp / nfs
# which may need its services if using no nameservers in resolv.conf.
# bind <= 24:9.3.1-11:
# These versions ran bind with order 11 in runlevel 2, after syslog
# at order 12 . BIND should run after syslog and now has order '- 13 87'.
#
    /sbin/chkconfig named resetpriorities
fi
:;