"status" function for init scripts
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
nis |
Invalid
|
Undecided
|
Unassigned | ||
apache2 (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
asterisk (Ubuntu) |
Invalid
|
Undecided
|
Unassigned | ||
at (Ubuntu) |
Fix Released
|
Wishlist
|
Dustin Kirkland | ||
bind9 (Ubuntu) |
Fix Released
|
Undecided
|
LaMont Jones | ||
cron (Ubuntu) |
Fix Released
|
Wishlist
|
Dustin Kirkland | ||
debian-policy (Debian) |
Fix Released
|
Unknown
|
|||
dovecot (Ubuntu) |
Fix Released
|
Wishlist
|
Dustin Kirkland | ||
lsb (Debian) |
Fix Released
|
Unknown
|
|||
lsb (Ubuntu) |
Fix Released
|
Wishlist
|
Dustin Kirkland | ||
nis (Ubuntu) |
Invalid
|
Undecided
|
Unassigned | ||
openssh (Ubuntu) |
Fix Released
|
Wishlist
|
Dustin Kirkland | ||
postgresql-8.3 (Ubuntu) |
Invalid
|
Undecided
|
Unassigned | ||
samba (Debian) |
Fix Released
|
Unknown
|
|||
samba (Ubuntu) |
Fix Released
|
Wishlist
|
Dustin Kirkland | ||
sysklogd (Ubuntu) |
Fix Released
|
Wishlist
|
Dustin Kirkland | ||
udev (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
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/
+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:/
[2] http://
[3] http://
Related branches
CVE References
Changed in udev: | |
status: | New → Invalid |
Changed in debian-policy: | |
status: | Unknown → New |
Changed in samba: | |
importance: | Undecided → Wishlist |
status: | New → Confirmed |
Changed in openssh: | |
importance: | Undecided → Wishlist |
status: | New → Triaged |
Changed in lsb: | |
status: | Unknown → New |
Changed in at: | |
assignee: | nobody → kirkland |
importance: | Undecided → Wishlist |
status: | New → In Progress |
Changed in openssh: | |
assignee: | nobody → kirkland |
status: | Triaged → In Progress |
Changed in dovecot: | |
assignee: | nobody → kirkland |
importance: | Undecided → Wishlist |
status: | New → In Progress |
Changed in samba: | |
assignee: | nobody → kirkland |
status: | Confirmed → In Progress |
Changed in sysklogd: | |
assignee: | nobody → kirkland |
importance: | Undecided → Wishlist |
status: | New → In Progress |
Changed in samba: | |
status: | Unknown → New |
Changed in bind9: | |
assignee: | nobody → lamont |
status: | Incomplete → Fix Committed |
Changed in lsb: | |
status: | New → Fix Released |
Changed in lsb: | |
status: | Unknown → New |
Changed in at: | |
status: | In Progress → Fix Released |
Changed in cron: | |
status: | In Progress → Fix Released |
Changed in dovecot: | |
status: | In Progress → Fix Released |
Changed in sysklogd: | |
status: | In Progress → Fix Released |
Changed in lsb: | |
status: | New → Fix Released |
Changed in nis: | |
assignee: | nobody → dennis-pattmann |
status: | New → In Progress |
Changed in nis: | |
status: | Fix Committed → Invalid |
status: | New → Fix Committed |
Changed in samba: | |
status: | In Progress → Fix Released |
Changed in samba (Debian): | |
status: | New → Fix Released |
Changed in debian-policy (Debian): | |
status: | New → Fix Released |
If bug #208010 goes too far, this bug report doesn't go far enough.
The "status" option should be required, not optional. Only if it can be
counted on will it be useful.
I'm interested in being able to check the status of services when I
suspend and resume a laptop. Some services must be stopped before a
suspend can happen; others must be restarted after a resume. But in all
cases the restart-on-resume should happen only if the service was
running before the suspend.
The "hibernate" package provides nice wrappers for suspend and resume,
including the ability to stop and restart services. But it can't
reliably restart exactly the services that were running, because it
cannot check which services were running.
The set of services actually running may not be the list that was
started automatically when the current run level was entered. Packages
such as "whereami" may stop or start services based on the current
network environment of a portable computer. Or the user may have
stopped or started a service manually. So the only way to know whether
a service is running is to ask it, via a "status" option.
< Stephen