hardy init script status action
Scott Kitterman
ubuntu at kitterman.com
Sat Mar 15 05:22:06 GMT 2008
On Thu, 13 Mar 2008 19:01:01 -0500 Dustin Kirkland
<dustin.kirkland at canonical.com> wrote:
>Howdy-
>
>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.
...
>First, we'd like to add a function, status_of_proc(),
>to /lib/lsb/init-functions (owned by lsb-base), which is already sourced
>by most scripts in /etc/init.d. The heavy lifting is performed by the
>pidofproc() function, which is already defined in that same file.
>
>+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 a series of patches to various init
>scripts essentially adding the following to the case handler:
Given the nearness of release, I doubt we can (or should) attempt anything
comprehensive at this point. We already have some existing inits that
should be redone to use the common function when it's added.
Since it seems the number of packages is small, perhaps instead of taking
even the small marginal risk associated with touching
/lib/lsb/init-functions, it would be better just to add that to each init
that we touch for Hardy. We could then spec this for the next release and
do it early.
Scott K
More information about the ubuntu-devel
mailing list