Another minor update to this patch, also in the vein of making it "set -e" safe.
These changes have been integrated into Ubuntu Intrepid. We thought you might integrate them into Debian Unstable as well. :-Dustin
--- lsb.unstable/lsb-3.2/init-functions 2008-05-01 10:07:37.000000000 -0500 +++ lsb.intrepid/lsb-3.2/init-functions 2008-06-05 00:01:36.000000000 -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" + status="0" + 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