Comment 7 for bug 203169

Revision history for this message
In , Bill Allombert (allomber) wrote : Re: Bug#291148: [PROPOSAL] Add a 'status' option in init.d scripts

On Tue, Jun 21, 2005 at 04:10:53PM -0500, Manoj Srivastava wrote:
> On Tue, 21 Jun 2005 21:57:35 +0200, <email address hidden> said:
>
> > On Wed, Jan 19, 2005 at 01:30:55AM +0100, Javier Fernández-Sanguino Peña wrote:
> >> --- policy.sgml.orig 2005-01-19 01:10:37.000000000 +0100
> >> +++ policy.sgml 2005-01-19 01:13:05.000000000 +0100
> >> @@ -5392,13 +5392,17 @@ <tag><tt>force-reload</tt></tag>
> >> <item>cause the configuration to be reloaded if the service
> >> supports this, otherwise restart the
> >> - service.</item>
> >> + service,</item>
> >> +
> >> + <tag><tt>status</tt></tag>
> >> + <item><p>show the status of the service (either running
> >> + or dead).</item>
> >> </taglist>
>
> > I don't think this is a sufficient specification.
>
> Umm, why? Why can't we leave it to the maintainer to determine
> the current status of the service?

That is not the question. The question is how to return it to the user.

> > We should make it clear what status should display in the different
> > case:
>
> > 1) init script does not start a daemon
> > 2.a) init script start a daemon which is running 2.b) init script
> > start a daemon which is not running
> > 3) init script start several daemons
> > 4) init script was disabled in config
>
> I think rather than trying to decree a policy, and over
> engineer an optional action for an init script meant mostly for user
> consumption, we should let the developers come up with whatever works
> best for them. Heck, even the LSB says nothing more about the status
> action (apart from specifying some exit codes).

Then the proposal is quite useless. Policy already allow initscript to
implement a status option. The only point of mention it in policy is to
get some amount of consistency among those that implement it.

> At this point, there are no existing standards or practices
> for it to warrant a more explicit policy; once we figure out, in
> practice, what would work best, we can _then_ try making policy,
> IMHO.

At keast the LSB document it, see LSB 20.2:

status print the current status of the service

If the status action is requested, the init script will return the
following exit status codes.

0 program is running or service is OK
1 program is dead and /var/run pid file exists
2 program is dead and /var/lock lock file exists
3 program is not running
4 program or service status is unknown
5-99 reserved for future LSB use
100-149 reserved for distribution use
150-199 reserved for application use
200-254 reserved

What is exactly printed is distro-specific, but as far as Debian is
concerned, we should propose something consistent with what is printed
by the other options(start stop, etc).

I would note that the LSB text say 'program' here whereas it said
'service' previously. This is inconsistent given that the service might
not be implemented by a program.

Cheers,
--
Bill. <email address hidden>

Imagine a large red swirl here.