summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Tkac <atkac@redhat.com>2011-01-05 12:58:29 +0100
committerAdam Tkac <atkac@redhat.com>2011-01-05 12:58:29 +0100
commitf214e0843b6acc94930482b6d4503904b02ef037 (patch)
tree3f4f887d43e6930142e2437456178b28b51660cc
parenta0a60a6bd59845c6f6aac65d5398c1e6c8b3b2a6 (diff)
Initscript should terminate only the correct "named" process (#622785).
Signed-off-by: Adam Tkac <atkac@redhat.com>
-rw-r--r--bind.spec5
-rwxr-xr-xnamed.init15
2 files changed, 14 insertions, 6 deletions
diff --git a/bind.spec b/bind.spec
index bf53e29..ca8f22e 100644
--- a/bind.spec
+++ b/bind.spec
@@ -22,7 +22,7 @@ Summary: The Berkeley Internet Name Domain (BIND) DNS (Domain Name System) serv
Name: bind
License: ISC
Version: 9.7.2
-Release: 9.%{PATCHVER}%{?dist}
+Release: 10.%{PATCHVER}%{?dist}
Epoch: 32
Url: http://www.isc.org/products/BIND/
Buildroot:%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
@@ -766,6 +766,9 @@ rm -rf ${RPM_BUILD_ROOT}
%endif
%changelog
+* Wed Jan 05 2011 Adam Tkac <atkac redhat com> 32:9.7.2-10.P3
+- initscript should terminate only the correct "named" process (#622785)
+
* Mon Dec 20 2010 Adam Tkac <atkac redhat com> 32:9.7.2-9.P3
- fix "krb5-self" update-policy rule processing
diff --git a/named.init b/named.init
index f567c07..325f71c 100755
--- a/named.init
+++ b/named.init
@@ -84,6 +84,10 @@ umount_chroot_conf()
done
}
+pidofnamed() {
+ pidofproc -p "$ROOTDIR/var/run/named/named.pid" "$named";
+}
+
# Check if all what named needs running
start()
{
@@ -118,7 +122,7 @@ start()
# all pre-start is done, lets start named
echo -n $"Starting named: "
- if [ -n "`/sbin/pidof -o %PPID "$named"`" ]; then
+ if [ -n "`pidofnamed`" ]; then
echo -n $"named: already running"
success
echo
@@ -136,7 +140,7 @@ start()
# check if configuration is correct
if [ -x /usr/sbin/named-checkconf ] && [ -x /usr/sbin/named-checkzone ] && /usr/sbin/named-checkconf $ckcf_options ${named_conf} >/dev/null 2>&1; then
- daemon /usr/sbin/"$named" -u named ${OPTIONS};
+ daemon --pidfile "$ROOTDIR/var/run/named/named.pid" /usr/sbin/"$named" -u named ${OPTIONS};
RETVAL=$?
if [ $RETVAL -eq 0 ]; then
rm -f /var/run/{named,named-sdb}.pid;
@@ -172,11 +176,12 @@ stop() {
[ -x /usr/sbin/rndc ] && /usr/sbin/rndc stop >/dev/null 2>&1;
RETVAL=$?
# was rndc successful?
- [ "$RETVAL" -eq 0 ] || killproc "$named" -TERM >/dev/null 2>&1
+ [ "$RETVAL" -eq 0 ] || \\
+ killproc -p "$ROOTDIR/var/run/named/named.pid" "$named" -TERM >/dev/null 2>&1
timeout=0
RETVAL=0
- while /sbin/pidof -o %PPID "$named" >/dev/null; do
+ while pidofnamed >/dev/null; do
if [ $timeout -ge $NAMED_SHUTDOWN_TIMEOUT ]; then
RETVAL=1
break
@@ -218,7 +223,7 @@ reload() {
[ "$EUID" != "0" ] && exit
echo -n $"Reloading "$named": "
- p=`/sbin/pidof -o %PPID "$named"`
+ p=`pidofnamed`
RETVAL=$?
if [ "$RETVAL" -eq 0 ]; then
/usr/sbin/rndc reload >/dev/null 2>&1 || /bin/kill -HUP $p;