--- Begin Message ---
- To: Debian Bug Tracking System <submit@bugs.debian.org>
- Subject: initscripts: remove some implementation details
- From: Ansgar Burchardt <ansgar@debian.org>
- Date: Thu, 26 Sep 2019 09:01:28 +0200
- Message-id: <156948128832.6930.17479874644588126489.reportbug@deep-thought.43-1.org>
Package: bugs.debian.org
Severity: normal
Tags: patch
The section on initscripts has too much implementation details about
/etc/rcn.d; these are better explained by external documentation.
Also the rationale for why `DISABLED=yes` (or similar) fits better
into a footnote than the main text (IMHO).
(Policy also should say something about LSB headers in "Writing the
scripts", but that will be a different patch.)
Ansgar
>From 4bdc0bfa5a08ae0481a9820c1d4bfb8b933afcc4 Mon Sep 17 00:00:00 2001
From: Ansgar <ansgar@debian.org>
Date: Thu, 26 Sep 2019 08:49:28 +0200
Subject: [PATCH 1/2] move rationale to discourage old practice into footnote
---
policy/ch-opersys.rst | 22 ++++++++++++----------
1 file changed, 12 insertions(+), 10 deletions(-)
diff --git a/policy/ch-opersys.rst b/policy/ch-opersys.rst
index 6e0c020..1b63064 100644
--- a/policy/ch-opersys.rst
+++ b/policy/ch-opersys.rst
@@ -554,16 +554,7 @@ administrator can enable autostarting the daemon using the command
``update-rc.d package enable``.
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.
+like ``DISABLED=yes`` in the package's ``/etc/default`` file. [#]_
Note that if your package changes runlevels or priority, you may have to
remove and recreate the links, since otherwise the old links may
@@ -1034,6 +1025,17 @@ Debian, so this section has been removed.
init scripts, may fail if ``set -e`` is in effect and echoing status messages to the
console fails, for example.
+.. [#]
+ 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.
+
.. [#]
Creating, modifying or removing a file in
``/usr/lib/mime/packages/`` using maintainer scripts will not
--
2.23.0
>From 82db1fc4300e2b6563f2436fadf3f964d567c65b Mon Sep 17 00:00:00 2001
From: Ansgar <ansgar@debian.org>
Date: Thu, 26 Sep 2019 08:54:03 +0200
Subject: [PATCH 2/2] refer to external documentation for implementation
details of /etc/rcn.d
---
policy/ch-opersys.rst | 65 ++++++++-----------------------------------
1 file changed, 12 insertions(+), 53 deletions(-)
diff --git a/policy/ch-opersys.rst b/policy/ch-opersys.rst
index 1b63064..5a647fd 100644
--- a/policy/ch-opersys.rst
+++ b/policy/ch-opersys.rst
@@ -329,59 +329,18 @@ The ``/etc/init.d`` directory contains the scripts executed by ``init``
at boot time and when the init state (or "runlevel") is changed (see
``init(8)``).
-There are at least two different, yet functionally equivalent, ways of
-handling these scripts. For the sake of simplicity, this document
-describes only the symbolic link method. However, it must not be assumed
-by maintainer scripts that this method is being used, and any automated
-manipulation of the various runlevel behaviors by maintainer scripts
-must be performed using ``update-rc.d`` as described below and not by
-manually installing or removing symlinks. For information on the
-implementation details of the other method, implemented in the
-``file-rc`` package, please refer to the documentation of that package.
-
-These scripts are referenced by symbolic links in the ``/etc/rcn.d``
-directories. When changing runlevels, ``init`` looks in the directory
-``/etc/rcn.d`` for the scripts it should execute, where ``n`` is the
-runlevel that is being changed to, or ``S`` for the boot-up scripts.
-
-The names of the links all have the form ``Smmscript`` or ``Kmmscript``
-where mm is a two-digit number and script is the name of the script
-(this should be the same as the name of the actual script in
-``/etc/init.d``).
-
-When ``init`` changes runlevel first the targets of the links whose
-names start with a ``K`` are executed, each with the single argument
-``stop``, followed by the scripts prefixed with an ``S``, each with the
-single argument ``start``. (The links are those in the ``/etc/rcn.d``
-directory corresponding to the new runlevel.) The ``K`` links are
-responsible for killing services and the ``S`` link for starting
-services upon entering the runlevel.
-
-For example, if we are changing from runlevel 2 to runlevel 3, init will
-first execute all of the ``K`` prefixed scripts it finds in
-``/etc/rc3.d``, and then all of the ``S`` prefixed scripts in that
-directory. The links starting with ``K`` will cause the referred-to file
-to be executed with an argument of ``stop``, and the ``S`` links with an
-argument of ``start``.
-
-The two-digit number mm is used to determine the order in which to run
-the scripts: low-numbered links have their scripts run first. For
-example, the ``K20`` scripts will be executed before the ``K30``
-scripts. This is used when a certain service must be started before
-another. For example, the name server ``bind`` might need to be started
-before the news server ``inn`` so that ``inn`` can set up its access
-lists. In this case, the script that starts ``bind`` would have a lower
-number than the script that starts ``inn`` so that it runs first:
-
-::
-
- /etc/rc2.d/S17bind
- /etc/rc2.d/S70inn
-
-The two runlevels 0 (halt) and 6 (reboot) are slightly different. In
-these runlevels, the links with an ``S`` prefix are still called after
-those with a ``K`` prefix, but they too are called with the single
-argument ``stop``.
+``systemd`` uses dependency information contained within the init
+scripts and symlinks in ``/etc/rcn.d`` to decide which scripts to run
+and in which order. The ``sysv-rc`` runlevel system uses symlinks in
+``/etc/rcn.d`` to decide which scripts to run and in which order, see
+the ``README.runlevels`` file shipped with ``sysv-rc`` for
+implementation details. Other alternatives might exist.
+
+Maintainer scripts must use ``update-rc.d`` as described below to
+interact with the service manage for requests such as enabling or
+disabling services. They should use ``invoke-rc.d`` as described below
+to invoke initscripts for requests such as starting and stopping
+service.
.. _s-writing-init:
--
2.23.0
--- End Message ---
--- Begin Message ---
Source: debian-policy
Source-Version: 4.4.1.2
We believe that the bug you reported is fixed in the latest version of
debian-policy, which is due to be installed in the Debian FTP archive.
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to 941194@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Sean Whitton <spwhitton@spwhitton.name> (supplier of updated debian-policy package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
Format: 1.8
Date: Fri, 29 Nov 2019 18:09:12 -0700
Source: debian-policy
Architecture: source
Version: 4.4.1.2
Distribution: unstable
Urgency: medium
Maintainer: Debian Policy Editors <debian-policy@lists.debian.org>
Changed-By: Sean Whitton <spwhitton@spwhitton.name>
Closes: 941194 941835 943880 944325 944332 944407
Changes:
debian-policy (4.4.1.2) unstable; urgency=medium
.
[ Sean Whitton ]
* Policy: Drop implementation details of sysvinit runlevels
Wording: Ansgar <ansgar@debian.org>
Seconded: Russ Allbery <rra@debian.org>
Seconded: Sean Whitton <spwhitton@spwhitton.name>
Closes: #941194
See also #943583.
* Fix "set -e" extraneous whitespace (Closes: #943880).
Thanks Sven Joachim for the patch.
* Fix 'multple' typo (Closes: #944407).
Thanks Ansgar for the patch.
* Improve some phrasing in 7.8 (Closes: #944325).
Thank you to Nicholas D Steeves for pointing out the problem and Russ
Allbery for the new text.
.
[ Russ Allbery ]
* Remove mention of the old Packaging Manual from the package
description. This is ancient history and no longer likely to be
helpful. Thanks, Holger Levsen. (Closes: #941835)
* Add missing close brackets to the examples in the Diversions
appendix. Thanks, Abou Al Montacir.
* Add explicit :manpage: markup to links to manual pages.
* Fix anchor syntax for s-signalingreboot section.
* Fix broken markup in a footnote about sponsored uploads. Thanks,
Guillem Jover. (Closes: #944332)
Checksums-Sha1:
ab4ac657a46222649894db2bb32ad608f220c021 2023 debian-policy_4.4.1.2.dsc
a7f91304696f0fe64aed3a701ecb9897f3ec410e 539060 debian-policy_4.4.1.2.tar.xz
Checksums-Sha256:
b3c09afafae4a15758cd08346467b1fe88313ea2f620ae30f08f36200e8e11b4 2023 debian-policy_4.4.1.2.dsc
c78b52e6f738a06a9611a1e8e148f78ff149902749425b644344d0569eb65932 539060 debian-policy_4.4.1.2.tar.xz
Files:
d5feed310dd812ccb8304fd3af39bdf9 2023 doc optional debian-policy_4.4.1.2.dsc
dbe9e039bbad7d57e51244c1db55ddf7 539060 doc optional debian-policy_4.4.1.2.tar.xz
-----BEGIN PGP SIGNATURE-----
iQIzBAEBCgAdFiEEm5FwB64DDjbk/CSLaVt65L8GYkAFAl3hwoMACgkQaVt65L8G
YkC0Iw//Ua4QqBqZ+CqnjErMwBU+cVpwePGqUWJDr8J1Sb6c7Q79U2h0XXXxbvg7
mWkmI3e5mTLa+nX22XENrB2mVM7tYybbafEuJsUndTU+AWQUnx5dk2lzckOGtgJF
GmPFoDpOOs2LjdTp3NrakCALZRe4y6Y1zn0Vui9Po8cY7WNGdEaaMLMg6AC8by0j
VQO9mQHAtuhBpthChuVZo0xoCE2WqwTRJKKkToKIw53C8HcE1zCyW202Fk8oWZJh
P3PFIcCB4i75OR8E4BlNfYhu4X8GKH1rB+jWzSZ5EBy8x5i22J7X/36ACOXX+k/r
ibk7z7GcUK+CwS47BuRe5bHsTj5A5VDQm5sH4MXfWgxpWl15YJEmU0kuPCqZvxrs
aWyRxWamPItV8AJjTUx7aZ29ry+vntrQvnFVy60/HjuIw5N8cP7zJ+ohW2ZQzThf
Ot+cL3QDR498yLGjcGY+3D7zWa/P56V2L0ZoN1BRg3cT9Ie3/xRxLQS9bsTtXeLc
ZfFhzOZrMcmdjkQgcbBYRrh3jIMR6eG5tLv8uxgpPyuA8elUA1H59yj+TH44x9z+
wGzyp1KrM0kz2VjsYiUmwRbZbYPOiXbF48ZKwHrIVaH9H1GL2bR0BlQFZ8LeTPwn
YONzltW0RWg88zeRniIEh2f2n6IF3LOUJV0GOpfd+YxtSo2bj/s=
=VGPL
-----END PGP SIGNATURE-----
--- End Message ---