aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2010-04-26 13:13:39 -0400
committerBill Nottingham <notting@redhat.com>2010-04-26 13:14:03 -0400
commit3419cedefba24e7af220c5b3a970ede42e20f1b0 (patch)
tree394cb883e189e578f346c8b9314753fe7205f36f
parent9cfe03139daa5b86ca0b0922917a1992ca34bb3f (diff)
downloadinitscripts-3419cedefba24e7af220c5b3a970ede42e20f1b0.tar
initscripts-3419cedefba24e7af220c5b3a970ede42e20f1b0.tar.gz
initscripts-3419cedefba24e7af220c5b3a970ede42e20f1b0.tar.bz2
initscripts-3419cedefba24e7af220c5b3a970ede42e20f1b0.tar.xz
initscripts-3419cedefba24e7af220c5b3a970ede42e20f1b0.zip
Handle being unable to read a specified pid file. (#584575)
-rw-r--r--rc.d/init.d/functions10
1 files changed, 8 insertions, 2 deletions
diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions
index 54a34837..08be0741 100644
--- a/rc.d/init.d/functions
+++ b/rc.d/init.d/functions
@@ -153,6 +153,7 @@ __pids_var_run() {
if [ -f "$pid_file" ] ; then
local line p
+ [ ! -r "$pid_file" ] && return 4 # "user had insufficient privilege"
while : ; do
read line
[ -z "$line" ] && break
@@ -294,8 +295,13 @@ killproc() {
# Find pid.
__pids_var_run "$1" "$pid_file"
- if [ -z "$pid_file" -a -z "$pid" ]; then
- pid="$(__pids_pidof "$1")"
+ RC=$?
+ if [ -z "$pid" ]; then
+ if [ -z "$pid_file" ]; then
+ pid="$(__pids_pidof "$1")"
+ else
+ [ "$RC" = "4" ] && { failure $"$base shutdown" ; return $RC ;}
+ fi
fi
# Kill it.