I have update the patch for this bug with two changes. The first makes killproc more "set -e" safe, by:
+ /bin/pidof -o %PPID $1 || status="$?" The second quotes "$status" and uses shell string comparisons rather than numerical comparisons. Surveying the rest of the init-functions script, this seems to be relatively more consistent. Thanks, :-Dustin
--- lsb.unstable/lsb-3.2/init-functions 2008-06-04 13:37:14.000000000 -0500 +++ lsb.intrepid/lsb-3.2-12ubuntu1/init-functions 2008-06-04 13:18:48.075319289 -0500 @@ -87,8 +87,8 @@ pidofproc () { fi fi if [ -x /bin/pidof -a ! "$specified" ]; then - /bin/pidof -o %PPID $1 - status="$?" + status="0" + /bin/pidof -o %PPID $1 || status="$?" if [ "$status" = 1 ]; then return 3 # program is not running fi @@ -146,6 +146,21 @@ killproc () { return 0 } +# Return LSB status +status_of_proc () { + local daemon name status + daemon="$1" + name="$2" + pidofproc $daemon >/dev/null + status="$?" + if [ "$status" = "0" ]; then + log_success_msg "$name is running." + else + log_failure_msg "$name is not running." + fi + return $status +} + log_use_fancy_output () { TPUT=/usr/bin/tput EXPR=/usr/bin/expr
signature.asc
Description: This is a digitally signed message part