Adding a status action to init scripts

Surely if you have administered a Linux server, you have used the scripts in /etc/init.d/ to start, stop, and restart system services. What about the status action to determine if a given service is up and running?

The Ubuntu Server team has initiated a concentrated effort to add status actions to the most commonly used init scripts. We’re recruiting current and aspiring Ubuntu developers to help patch these init scripts. Some Unix shell programming and basic Debian packaging skills are all that is required.

Basically, you need to do:

  1. grab the source
  2. add two lines to the service’s init script
  3. add a dependency in the control file
  4. create a changelog entry
  5. post a debdiff to a Launchpad bug.

There is detailed step-by-step checklist for creating and submitting such packages on the wiki page.

The Linux Standard Base 3.1 has a specification for init scripts actions. A simple function has been added to the LSB base library /lib/lsb/init-functions. This shell function, status_of_proc(), can be used in most init scripts to report status.

The list of init scripts that need work is also maintained in the wiki page. Join us in IRC at #ubuntu-server if you are interested in helping!

2 Responses to “Adding a status action to init scripts”

  1. Tyrone Says:

    Is this going upstream, is upstream not suitable, or not interested? Sounds like this would be a great thing to get all around so more tools can rely on it and use it.

  2. dustinkirkland Says:

    The status_of_proc() library function is already in Debian’s lsb-base package.

    The individual patches to each package should definitely be pushed back to Debian.

    As for the projects upstream of Debian, init scripts are generally handled at a distribution level.


Leave a Reply