Package: hal
Version: 0.5.11-2
Severity: normal
Tags: patch

The hal init script could really use a 'status' action, as defined in
the LSB specification [1].  Such an action allows a system administrator
to poll the service's init script and retrieve the status (running or
not) of the daemon.

Recently, a new function, status_of_proc(), was added
to /lib/lsb/init-functions that makes this relatively trivial.  I've
attached a patch that adds this functionality.

-Tim 'Shaggy' Bielawa

[1]
http://refspecs.freestandards.org/LSB_3.1.0/LSB-Core-generic/LSB-Core-generic/iniscrptact.html
diff -u hal-0.5.11/debian/hal.init hal-0.5.11/debian/hal.init
--- hal-0.5.11/debian/hal.init
+++ hal-0.5.11/debian/hal.init
@@ -75,6 +75,9 @@
        do_stop
        log_end_msg $?
        ;;
+  status)
+       status_of_proc -p $PIDFILE $DAEMON $NAME && exit 0 || exit $?
+       ;;
   restart|force-reload)
        log_daemon_msg "Restarting $DESC" "$NAME"
        do_stop
@@ -83,7 +86,7 @@
        log_end_msg $?
        ;;
   *)
-       log_success_msg "Usage: $0 {start|stop|restart|force-reload}" >&2
+       log_success_msg "Usage: $0 {start|stop|status|restart|force-reload}" >&2
        exit 1
        ;;
 esac
diff -u hal-0.5.11/debian/control hal-0.5.11/debian/control
--- hal-0.5.11/debian/control
+++ hal-0.5.11/debian/control
@@ -11,7 +11,7 @@
 
 Package: hal
 Architecture: any
-Depends: ${shlibs:Depends}, adduser, pciutils, usbutils, udev (>= 0.065), dbus 
(>= 0.61), lsb-base, hal-info (>= 20070402), pm-utils, mount (>= 2.13)
+Depends: ${shlibs:Depends}, adduser, pciutils, usbutils, udev (>= 0.065), dbus 
(>= 0.61), lsb-base (>= 3.2-14), hal-info (>= 20070402), pm-utils, mount (>= 
2.13)
 Recommends: eject, libsmbios-bin [i386 amd64]
 Suggests: gnome-device-manager
 Description: Hardware Abstraction Layer

Reply via email to