[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#941194: initscripts: remove some implementation details



Ansgar <ansgar@43-1.org> writes:
> Russ Allbery writes:

>> I'm hesitant to remove all discussion of run levels because package
>> maintainers are still responsible for choosing a run level at which to
>> start their service and providing that run level as an argument to
>> update-rc.d.

> No, maintainer scripts call `update-rc.d <name> defaults`.  There is no
> runlevel involved.  The runlevel is only in the LSB init script magic
> comment.  However those aren't explained anywhere in Policy, even though
> the dependency part was more important than the runlevel part (IMHO)...

Oh, I see, the runlevels are only relevant for the disable and enable
commands, which are never used by packages.

Objection removed entirely.  Thanks!

>> How about, rather than moving it to a footnote, rephrasing it as follows?
>>
>>     Except when the package has been removed but not purged, as described
>>     above, the ``/etc/init.d`` script should not decide whether or not to
>>     start the daemon based on configuration settings (such as settings in
>>     ``/etc/default``) or silently exit successfully when the daemon could
>>     not be started.

> I think this part isn't that interesting:

>>     This causes inconsistent and confusing behavior such
>>     as ``service <package> start`` returning success but not starting the
>>     service; services with a dependency on this service starting even
>>     though the service isn’t running; and init system status commands
>>     claiming that the service was started.

> (It's a rationale, Policy usually doesn't have those.)

The lack of rationales is a bug in Policy.  We should have rationales;
otherwise, years later, it's difficult or impossible to understand what
the motivation was for some requirement.  (See also Chesterton's fence.)

Ideally we'd have some better way of representing them so that you could
enable or disable them when reading Policy if you want just the facts, but
I don't want to leave them out when we have them even though they can be a
bit wordy to include.

>>     If the ``/etc/init.d`` script
>>     is invoked with the ``start`` or ``restart`` arguments and the service
>>     could not or should not be started, it should produce an appropriate
>>     error message and exit with a non-zero status.
>>
>> and then moving this whole paragraph into 9.3.2, probably as the
>> second-to-last paragraph?

> Besides that I believe it's fine.

> 9.3.2 still has other interesting parts that I want to change (such as
> suggesting editing /etc/init.d/<name> is a good way to disable
> services).  For the conffile-disliking person it also contains the
> admission that conffiles are so user-unfriendly on upgrades that there
> are conffiles for conffiles, i.e. /etc/default/* ;-)

Yeah, I think that making init scripts conffiles was, in retrospect, a
mistake, although an understandable one and hard to avoid due to the lack
of any other override mechanism.

-- 
Russ Allbery (rra@debian.org)              <https://www.eyrie.org/~eagle/>


Reply to: