hardy init script status action

Matt Zimmerman mdz at ubuntu.com
Fri Mar 14 16:39:35 GMT 2008


On Thu, Mar 13, 2008 at 07:01:01PM -0500, Dustin Kirkland wrote:
> Several members of the Ubuntu Server community (primarily Onno Benschop
> and myself) have been looking at the init scripts that drive
> starting/stopping of some of the core daemons in Ubuntu Server.  We've
> noticed that only a very few (apparmor, cupsys, mysql, postfix,
> postgresql) have implemented the "status" action.
> 
> The Linux Standard Base init script specification [1] describes the
> status action in detail, and requires it for LSB compliance.  In brief,
> it provides a centralized and direct way of determine if a given service
> is running or not, with a bit 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 [1].
> [...]
> This addition would be followed by a series of patches to various init
> scripts essentially adding the following to the case handler:
> 
> + status)
> +   status_of_proc "$DAEMON" "$NAME"
> +   exit $?
> +   ;;

So long as, wherever possible, this uses more reliable methods (pid files,
control sockets, etc.), I don't see a problem with the general design.

> The risk should be minimal.  It will clearly not affect the
> functionality of starting and stopping daemons.  And there should be no
> chance of regression, as we're talking about adding a "status" handler
> where this functionality did not exist before.

There is always a chance of regression when modifying scripts which are
critical for proper system functionality; for example, a typo in
/lib/lsb/init-functions would be a very bad scene.

Be sure that each script is thoroughly tested after being extended in this
way.

> We will work through the appropriate channels for filing Launchpad bugs,
> submitting debdiffs, and requesting Feature Freeze exceptions.  As minor
> as these code changes are, it would affect several packages, and we're
> mentioning it here in the interest of gathering any meaningful comments
> on the matter as soon as possible.

How many scripts do you plan to touch?  This could involve quite a few
freeze exceptions, which, although low-risk, always require some additional
effort on the part of the release managers, etc.

-- 
 - mdz



More information about the ubuntu-devel mailing list