diff options
-rw-r--r-- | initscripts.spec | 2 | ||||
-rwxr-xr-x | rc.d/init.d/functions | 10 |
2 files changed, 9 insertions, 3 deletions
diff --git a/initscripts.spec b/initscripts.spec index 5f847acb..48cc9821 100644 --- a/initscripts.spec +++ b/initscripts.spec @@ -4,7 +4,7 @@ Name: initscripts Version: %{version} Copyright: GPL Group: System Environment/Base -Release: 2 +Release: 3 Source: initscripts-%{version}.tar.gz BuildRoot: /var/tmp/initbld Requires: mingetty, bash, /bin/awk, /bin/sed, mktemp, e2fsprogs, console-tools diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions index fcd61237..eca7f56f 100755 --- a/rc.d/init.d/functions +++ b/rc.d/init.d/functions @@ -90,6 +90,7 @@ daemon() { # A function to stop a program. killproc() { + RC=0 # Test syntax. if [ $# = 0 ]; then echo "Usage: killproc {program} [signal]" @@ -129,11 +130,15 @@ killproc() { fi fi fi - ps h $pid >/dev/null 2>&1 && failure "$base shutdown" || success "$base shutdown" + ps h $pid >/dev/null 2>&1 + RC=$? + [ $RC -eq 0 ] && failure "$base shutdown" || success "$base shutdown" # use specified level only else if ps h $pid >/dev/null 2>&1; then - kill $killlevel $pid && success "$base $killlevel" || failure "$base $killlevel" + kill $killlevel $pid + RC=$? + [ $RC -eq 0 ] && success "$base $killlevel" || failure "$base $killlevel" fi fi else @@ -144,6 +149,7 @@ killproc() { if [ "$notset" = "1" ]; then rm -f /var/run/$base.pid fi + return $RC } # A function to find the pid of a program. |