On Thu, Aug 03, 2017 at 10:55:30AM -0400, Sean Whitton wrote: > I second all of Andreas' patches except the 5th and 8th. I've attached > the diff to which my second applies. > > The 5th and 8th patches introduce a normative requirement to use > debhelper. This is a first for policy, which up to now only comments > that using debhelper is "easiest".
thanks again for spotting this, Sean! > I've spoken to h01ger and gregoa IRL and they say that they missed the > magic word "should" which is what makes debhelper required by these > patches. So I'm seeking seconds for the following replacement for > Andreas' 5th and 8th patches: > > diff --git a/policy.xml b/policy.xml > index 3daa532..c6c7412 100644 > --- a/policy.xml > +++ b/policy.xml > @@ -8525,6 +8525,14 @@ fi</programlisting> > <literal>update-rc.d</literal>, please consult its man page > > <citerefentry><refentrytitle>update-rc.d</refentrytitle><manvolnum>8</manvolnum></citerefentry>. > </para> > + <para> > + It is easiest for packages not to call > + <command>update-rc.d</command> directly, but instead use > + debhelper programs that add the required > + <command>update-rc.d</command> calls automatically. See > + <command>dh_installinit</command>, > + <command>dh_systemd_enable</command>, etc. > + </para> > </section> > > <section id="s9.3.3.2"> > @@ -8573,6 +8581,14 @@ invoke-rc.d <replaceable>package</replaceable> > <replaceable>action</replaceable> > <command>invoke-rc.d</command>, please consult its man page > > <citerefentry><refentrytitle>invoke-rc.d</refentrytitle><manvolnum>8</manvolnum></citerefentry>. > </para> > + <para> > + It is easiest for packages not to call > + <command>invoke-rc.d</command> directly, but instead use > + debhelper programs that add the required > + <command>invoke-rc.d</command> calls automatically. See > + <command>dh_installinit</command>, > + <command>dh_systemd_start</command>, etc. > + </para> > </section> > > </section> > > -- > Sean Whitton > diff --git a/policy.sgml b/policy.sgml > index 9cd182b..2b37df8 100644 > --- a/policy.sgml > +++ b/policy.sgml > @@ -7053,12 +7053,6 @@ Built-Using: grub2 (= 1.99-9), loadlin (= 1.6e-1) > in <file>/run</file> should be stored on a temporary > file system. > </p> > - <p> > - Packages must not assume the <file>/run</file> > - directory exists or is usable without a dependency > - on <tt>initscripts (>= 2.88dsf-13.3)</tt> until the > - stable release of Debian supports <file>/run</file>. > - </p> > </item> > <item> > <p> > @@ -7654,7 +7648,7 @@ test -f <var>program-executed-later-in-script</var> || > exit 0 > </sect1> > > <sect1> > - <heading>Interfacing with the initscript system</heading> > + <heading>Interfacing with init systems</heading> > > <p> > Maintainers should use the abstraction layer provided by > @@ -7697,19 +7691,6 @@ test -f <var>program-executed-later-in-script</var> || > exit 0 > </p> > > <p> > - By default <prgn>update-rc.d</prgn> will start services in > - each of the multi-user state runlevels (2, 3, 4, and 5) > - and stop them in the halt runlevel (0), the single-user > - runlevel (1) and the reboot runlevel (6). The system > - administrator will have the opportunity to customize > - runlevels by simply adding, moving, or removing the > - symbolic links in <file>/etc/rc<var>n</var>.d</file> if > - symbolic links are being used, or by modifying > - <file>/etc/runlevel.conf</file> if the <tt>file-rc</tt> method > - is being used. > - </p> > - > - <p> > To get the default behavior for your package, put in your > <prgn>postinst</prgn> script > <example compact="compact"> > @@ -7727,15 +7708,6 @@ test -f <var>program-executed-later-in-script</var> || > exit 0 > </p> > > <p> > - This will use a default sequence number of 20. If it does > - not matter when or in which order the <file>init.d</file> > - script is run, use this default. If it does, then you > - should talk to the maintainer of the <prgn>sysvinit</prgn> > - package or post to <tt>debian-devel</tt>, and they will > - help you choose a number. > - </p> > - > - <p> > For more information about using <tt>update-rc.d</tt>, > please consult its man page <manref name="update-rc.d" > section="8">. > @@ -7756,8 +7728,8 @@ test -f <var>program-executed-later-in-script</var> || > exit 0 > <p> > The package maintainer scripts must use > <prgn>invoke-rc.d</prgn> to invoke the > - <file>/etc/init.d/*</file> initscripts, instead of > - calling them directly. > + <file>/etc/init.d/*</file> initscripts or equivalent, > + instead of calling them directly. > </p> > > <p> > @@ -7769,17 +7741,11 @@ test -f <var>program-executed-later-in-script</var> > || exit 0 > </p> > > <p> > - Most packages will simply need to change: > - <example compact="compact">/etc/init.d/<package> > - <action></example> in their <prgn>postinst</prgn> > - and <prgn>prerm</prgn> scripts to: > + Most packages will simply use: > <example compact="compact"> > - if which invoke-rc.d >/dev/null 2>&1; then > invoke-rc.d <var>package</var> <action> > - else > - /etc/init.d/<var>package</var> <action> > - fi > </example> > + in their <prgn>postinst</prgn> and <prgn>prerm</prgn> scripts. > </p> > > <p> > @@ -7798,226 +7764,19 @@ test -f <var>program-executed-later-in-script</var> > || exit 0 > </sect1> > > <sect1> > - <heading>Boot-time initialization</heading> > - > - <p> > - There used to be another directory, <file>/etc/rc.boot</file>, > - which contained scripts which were run once per machine > - boot. This has been deprecated in favour of links from > - <file>/etc/rcS.d</file> to files in <file>/etc/init.d</file> as > - described in <ref id="/etc/init.d">. Packages must not > - place files in <file>/etc/rc.boot</file>. > - </p> > - </sect1> > - > - <sect1> > <heading>Example</heading> > > <p> > An example on which you can base your > <file>/etc/init.d</file> scripts is found in > <file>/etc/init.d/skeleton</file>. > + Examples on which you can base your systemd integration on > + is available in the man page <manref name="systemd.unit" > section="8">. > </p> > > </sect1> > </sect> > > - <sect> > - <heading>Console messages from <file>init.d</file> scripts</heading> > - > - <p> > - This section describes the formats to be used for messages > - written to standard output by the <file>/etc/init.d</file> > - scripts. The intent is to improve the consistency of > - Debian's startup and shutdown look and feel. For this > - reason, please look very carefully at the details. We want > - the messages to have the same format in terms of wording, > - spaces, punctuation and case of letters. > - </p> > - > - <p> > - Here is a list of overall rules that should be used for > - messages generated by <file>/etc/init.d</file> scripts. > - </p> > - > - <p> > - <list> > - <item> > - The message should fit in one line (fewer than 80 > - characters), start with a capital letter and end with > - a period (<tt>.</tt>) and line feed (<tt>"\n"</tt>). > - </item> > - > - <item> > - If the script is performing some time consuming task in > - the background (not merely starting or stopping a > - program, for instance), an ellipsis (three dots: > - <tt>...</tt>) should be output to the screen, with no > - leading or tailing whitespace or line feeds. > - </item> > - > - <item> > - The messages should appear as if the computer is telling > - the user what it is doing (politely :-), but should not > - mention "it" directly. For example, instead of: > - <example compact="compact"> > -I'm starting network daemons: nfsd mountd. > - </example> > - the message should say > - <example compact="compact"> > -Starting network daemons: nfsd mountd. > - </example> > - </item> > - </list> > - </p> > - > - <p> > - <tt>init.d</tt> script should use the following standard > - message formats for the situations enumerated below. > - </p> > - > - <p> > - <list> > - <item> > - <p>When daemons are started</p> > - > - <p> > - If the script starts one or more daemons, the output > - should look like this (a single line, no leading > - spaces): > - <example compact="compact"> > -Starting <var>description</var>: <var>daemon-1</var> ... <var>daemon-n</var>. > - </example> > - The <var>description</var> should describe the > - subsystem the daemon or set of daemons are part of, > - while <var>daemon-1</var> up to <var>daemon-n</var> > - denote each daemon's name (typically the file name of > - the program). > - </p> > - > - <p> > - For example, the output of <file>/etc/init.d/lpd</file> > - would look like: > - <example compact="compact"> > -Starting printer spooler: lpd. > - </example> > - </p> > - > - <p> > - This can be achieved by saying > - <example compact="compact"> > -echo -n "Starting printer spooler: lpd" > -start-stop-daemon --start --quiet --exec /usr/sbin/lpd > -echo "." > - </example> > - in the script. If there are more than one daemon to > - start, the output should look like this: > - <example compact="compact"> > -echo -n "Starting remote file system services:" > -echo -n " nfsd"; start-stop-daemon --start --quiet nfsd > -echo -n " mountd"; start-stop-daemon --start --quiet mountd > -echo -n " ugidd"; start-stop-daemon --start --quiet ugidd > -echo "." > - </example> > - This makes it possible for the user to see what is > - happening and when the final daemon has been started. > - Care should be taken in the placement of white spaces: > - in the example above the system administrators can > - easily comment out a line if they don't want to start > - a specific daemon, while the displayed message still > - looks good. > - </p> > - </item> > - > - <item> > - <p>When a system parameter is being set</p> > - > - <p> > - If you have to set up different system parameters > - during the system boot, you should use this format: > - <example compact="compact"> > -Setting <var>parameter</var> to "<var>value</var>". > - </example> > - </p> > - > - <p> > - You can use a statement such as the following to get > - the quotes right: > - <example compact="compact"> > -echo "Setting DNS domainname to \"$domainname\"." > - </example> > - </p> > - > - <p> > - Note that the same symbol (<tt>"</tt>) <!-- " --> is used > - for the left and right quotation marks. A grave accent > - (<tt>`</tt>) is not a quote character; neither is an > - apostrophe (<tt>'</tt>). > - </p> > - </item> > - > - <item> > - <p>When a daemon is stopped or restarted</p> > - > - <p> > - When you stop or restart a daemon, you should issue a > - message identical to the startup message, except that > - <tt>Starting</tt> is replaced with <tt>Stopping</tt> > - or <tt>Restarting</tt> respectively. > - </p> > - > - <p> > - For example, stopping the printer daemon will look like > - this: > - <example compact="compact"> > -Stopping printer spooler: lpd. > - </example> > - </p> > - </item> > - > - <item> > - <p>When something is executed</p> > - > - <p> > - There are several examples where you have to run a > - program at system startup or shutdown to perform a > - specific task, for example, setting the system's clock > - using <prgn>netdate</prgn> or killing all processes > - when the system shuts down. Your message should look > - like this: > - <example compact="compact"> > -Doing something very useful...done. > - </example> > - You should print the <tt>done.</tt> immediately after > - the job has been completed, so that the user is > - informed why they have to wait. You can get this > - behavior by saying > - <example compact="compact"> > -echo -n "Doing something very useful..." > -do_something > -echo "done." > - </example> > - in your script. > - </p> > - </item> > - > - <item> > - <p>When the configuration is reloaded</p> > - > - <p> > - When a daemon is forced to reload its configuration > - files you should use the following format: > - <example compact="compact"> > -Reloading <var>description</var> configuration...done. > - </example> > - where <var>description</var> is the same as in the > - daemon starting message. > - </p> > - </item> > - </list> > - </p> > - </sect> > - > <sect id="cron-jobs"> > <heading>Cron jobs</heading> > seconded. -- cheers, Holger
signature.asc
Description: Digital signature