Adding a status action to init scripts

August 3, 2008

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!

One Response to “Adding a status action to init scripts”

Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: