InitScriptStatusActions
2878
Comment: formatting
|
2861
|
Deletions are marked like this. | Additions are marked like this. |
Line 29: | Line 29: |
* OnnoBenschop/ubuntu-server/init.d-status | * https://wiki.ubuntu.com/OnnoBenschop/ubuntu-server/init.d-status |
Line 51: | Line 51: |
* don't if you're sending to Debian! |
Overview
The LSB suggests that init scripts provide a status action:
status_of_proc() library function in lsb-base
DustinKirkland has been working with Debian to provide a status_of_proc() method in /lib/lsb/init-functions, which is provided by the lsb-base package. This function is present as of lsb-3.2-13:
In the meantime, this functionality has been merged into Ubuntu's lsb-base package in lsb 3.2-12ubuntu3:
This diff should be dropped as soon as Debian accepts the functionality and Ubuntu merges the package into Intrepid.
various init script callers
DustinKirkland has provided patches to the key service init scripts that are installable from the Ubuntu Server CD:
at: wiki:247091
bind9: wiki:247084
cron: wiki:201504
dovecot: wiki:247096
openssh: wiki:247103
samba: wiki:247087
syslogkd: wiki:247106
OnnoBenschop has provided a script to detect, and compiled a list of init scripts that are lacking status action here:
Countless other init scripts could/should be patched to provide this functionality.
Patch Checklist
When you encounter an init script that lacks a status action:
- Determine the source package
- dpkg -S /etc/init.d/FOO
- Open a Bug in Launchpad against the package
- Grab the source
- apt-get source FOO
- sudo apt-get build-dep FOO
- Locate the init script in the source tree, often:
- debian/*.init
- debian/rc
- Patch the source to
- have the init script call status_of_proc()
- have the init script add "status" to the usage statement
add a dependency in debian/control for lsb >= 3.2-12ubuntu3
- if you're sending to Ubuntu
- add the changelog entry referencing your Launchpad bug
- Build a source package
- debuild -S
- Generate a patch
- debdiff
- Compare your work to some of the other patches that did similar things.
See the patch for atd:
Or, perhaps have a look at the patch for openssh-server, which passes a pidfile to status_of_proc():
However, some are more complicated than others, such as samba:
- Add your patch to the Launchpad bug you filed
InitScriptStatusActions (last edited 2009-11-29 13:27:58 by 77-21-62-108-dynip)