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

Bug#601455: Full patch for this bug -- seeking seconds



Sean Whitton <spwhitton@spwhitton.name> writes:

> diff --git a/policy/ch-opersys.rst b/policy/ch-opersys.rst
> index 7d9e20a..193e3d1 100644
> --- a/policy/ch-opersys.rst
> +++ b/policy/ch-opersys.rst
> @@ -537,6 +537,29 @@ and in your ``postrm``
>          update-rc.d package remove
>      fi

> +The default behaviour is to enable autostarting your package's daemon.
> +If the daemon should not be autostarted unless the local administrator
> +has explicitly requested this, instead add to your ``postinst`` script
> +
> +::
> +
> +    update-rc.d package defaults-disabled

Tiny formatting nit: I usually prefer to put the double-colon at the end
of the previous paragraph when the literal text is introduced explicitly
by that package, instead of on a line by itself.

> +and add a dependency on ``init-system-helpers (>= 1.5.0)``, which
> +introduced the ``defaults-disabled`` option.
> +
> +An older practice, which should not be used, was to include a line
> +like ``DISABLED=yes`` in the package's ``/etc/default`` file.  The
> +package's init script would not start the service until the local
> +system administrator changed this to ``DISABLED=no``, or similar.  The
> +problem with this approach was that it hides from the init system
> +whether or not the daemon should actually be started, which leads to
> +inconsistent and confusing behavior: ``service <package> start`` may
> +return success but not start the service; services with a dependency
> +on this service will be started even though the service isn't running;
> +and init system status commands may incorrectly claim that the service
> +was started.
> +
>  Note that if your package changes runlevels or priority, you may have to
>  remove and recreate the links, since otherwise the old links may
>  persist. Refer to the documentation of ``update-rc.d``.

Looks good to me.  Seconded.

That said, I don't think this completely addresses all of the merged bugs,
since it leaves undocumented how the local administrator is supposed to
disable a service.  I realize Policy isn't about user-facing
documentation, but I think it might still be worth a mention in here
somewhere that the local administrator can disable a service with
update-rc.d <service> disable.  The advantage of mentioning this in Policy
is that package maintainers may see it and just document that approach if
they get questions from users about disabling their service.

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


Reply to: