** Changed in: debian-policy (Debian) Status: New => Fix Released
-- You received this bug notification because you are a member of Ubuntu Touch seeded packages, which is subscribed to lsb in Ubuntu. https://bugs.launchpad.net/bugs/203169 Title: "status" function for init scripts Status in nis: Invalid Status in apache2 package in Ubuntu: Fix Released Status in asterisk package in Ubuntu: Invalid Status in at package in Ubuntu: Fix Released Status in bind9 package in Ubuntu: Fix Released Status in cron package in Ubuntu: Fix Released Status in dovecot package in Ubuntu: Fix Released Status in lsb package in Ubuntu: Fix Released Status in nis package in Ubuntu: Invalid Status in openssh package in Ubuntu: Fix Released Status in postgresql-8.3 package in Ubuntu: Invalid Status in samba package in Ubuntu: Fix Released Status in sysklogd package in Ubuntu: Fix Released Status in udev package in Ubuntu: Invalid Status in debian-policy package in Debian: Fix Released Status in lsb package in Debian: Fix Released Status in samba package in Debian: Fix Released Bug description: Binary package hint: lsb Ubuntu Hardy, lsb-base 3.1-24ubuntu2 This bug has been discussed on the Ubuntu-devel mailing list [1]. Only a very few of the service init scripts in /etc/init.d, (apparmor, cupsys, mysql, postfix, postgresql) have implemented the "status" action. The Linux Standard Base init script specification [2] describes the status action in detail, and requires it for LSB compliance. It provides a centralized and direct way of determine if a given service is running or not, with a more sophistication than grepping a process listing. It logs a message to standard out, and exits with one of a number of meaningful codes, also defined in [2]. Users and system administrators with experience in LSB-compliant distributions can be frustrated by a lack of a standard way to determine if a given service is running or not in Ubuntu. Given the LTS designation of Hardy and our interest in furthering the Ubuntu Server, we'd like to add this functionality to several of the init scripts for core daemons that ship on the Ubuntu Server ISO. It will also facilitate the integration with ebox and other status gathering and reporting tools. We suggest solving this by adding a function to /lib/lsb/init- functions, which is already sourced by most scripts in /etc/init.d. The heavy lifting is performed by the pidofproc() function, which is already defined in that same file. (A proper debdiff will follow.) +status_of_proc () { + local daemon name status + daemon="$1" + name="$2" + pidofproc $daemon >/dev/null + status=$? + if [ $status -eq 0 ]; then + log_success_msg "$name is running." + else + log_failure_msg "$name is not running." + fi + return $status +} This addition would be followed by patches to init scripts essentially adding a case handler: + status) + status_of_proc "$DAEMON" "$NAME" + exit $? + ;; The risk should be minimal. It will clearly not affect the functionality of starting and stopping daemons, and thus a minimal chance of regression. We will push the changes to Debian, as there is a similar bug in Debian's bug tracker [3]. [1] https://lists.ubuntu.com/archives/ubuntu-devel/2008-March/025176.html [2] http://refspecs.freestandards.org/LSB_3.1.0/LSB-Core-generic/LSB-Core-generic/iniscrptact.html [3] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=291148 To manage notifications about this bug go to: https://bugs.launchpad.net/nis/+bug/203169/+subscriptions -- Mailing list: https://launchpad.net/~touch-packages Post to : touch-packages@lists.launchpad.net Unsubscribe : https://launchpad.net/~touch-packages More help : https://help.launchpad.net/ListHelp