Bug#919507: Reboot required patch for Debian policy
Hi Sean,
On Sun, 20 Jan 2019 15:02:05 -0700
Sean Whitton <spwhitton@spwhitton.name> wrote:
> > It is clear to me that a reboot will occur whenever
> > /var/run/reboot-required exists, regardless of the
> > state of /var/run/reboot-required.pkgs.
> >
> > It is not clear to me where reboot-required.pkgs is used.
>
> Your current patch suggests that the purpose of reboot-required.pkgs
> is to inform users of which package needs a reboot. I take it this
> is your guess as to the file's purpose? How sure are you about
> this? We shouldn't write something in Policy that we don't properly
> understand.
>
> > +To inform users as to which package(s)
> > +require a reboot, add the name of the package(s) requiring the
> > reboot +to ``/run/reboot-required.pkgs``. Programs should not add a
> > package +name to ``/run/reboot-required.pkgs`` if it is already
> > present there.
>
> I suggest "It is conventional to append the package name to
> ``/run/reboot-required.pkgs``" to avoid saying what the file is for,
> since we're not sure.
I did look through the "reboot-required.pkgs" hits
at codesearch.debian.org. At this point I can't recall exactly which
packages I looked at and which I didn't but I looked at better
than 50% of them.
(My general approach to researching all issues
related to this bug report is to look at the code involving
scripting languages but not bother to track, say, #define
references through compiled code.)
Everywhere I've looked for reboot-required.pkgs I've found
code equivalent to:
echo "Rebooting due to the following packages:"
cat /var/run/reboot-required.pkgs
I'm 99% confident that _a_ purpose of reboot-required.pkgs
is to provide a list of the packages requiring a reboot
to a human. And notification did not seem to be via logs.
I can't say if the file has any other purpose.
Regardless of the above, I've made your change as suggested.
The important thing I want to convey is that reboot-required.pkgs
does not affect the reboot signal. It does something supplementary.
Better not to over-specify.
It is also worth nothing at this point that kubernetes appears
to be touching reboot-required and adding to reboot-required.pkgs, but
doing so in non-package-installation related code. AFAICT. At least
that's what I recall now after a short glance through the code
some time ago. This is why I added the bit about regular
programs being able to signal for reboot.
> > +An expected time to signal that a reboot is required is upon
> > +installation or upgrade of a package. Signaling is called for
> > when a +reboot is needed to fully apply the changes a package
> > introduces. The +appropriate place to manipulate reboot related
> > files is expected to be +in the ``postinst`` maintainer script when
> > it is called as ``postinst +configure
> > most-recently-configured-version`` because this is when it +is
> > known that the package successfully installed and configured.
>
> Expressions like "expected" and "is called for" sound like they are
> normative, but it seems like your aim in this paragraph is to describe
> the purpose of a feature, rather than to specify how it may and may
> not be used.
Yes.
> Let's try to avoid giving the impression of normativity.
>
> How about:
>
> The ``/run/reboot-required`` mechanism is used when a reboot is
> needed to fully apply the changes introduced by a package
> installation or upgrade. Typically it is the ``postinst``
> maintainer script that touches ``/run/reboot-required``, at the
> end of a successful configuration of the package.
I used your text, removing an "a".
>
> > +Note that the Operating System is not guaranteed to act on these
> > +files. When, and whether, a reboot occurs is dependent upon the
> > +installation and configuration of a package which provides a reboot
> > +feature. The same is true of user notifications involving
> > reboot.
>
> It seems obvious that touching ``/run/reboot-required`` does not
> trigger a reboot, and typical Debian systems never reboot by
> themselves. IMO this paragraph is unnecessarily verbose. How about:
>
> There are no guarantees provided by the ``/var/reboot-required``
> convention as to when the required reboot will occur.
>
Shorter is better. I tweaked slightly.
Attached: reboot-required_v5.patch
Thanks for all the editing!
Regards,
Karl <kop@meme.com>
Free Software: "You don't pay back, you pay forward."
-- Robert A. Heinlein
diff --git a/policy/ch-opersys.rst b/policy/ch-opersys.rst
index 59c92ec..8276bfe 100644
--- a/policy/ch-opersys.rst
+++ b/policy/ch-opersys.rst
@@ -1040,3 +1040,33 @@ Debian, so this section has been removed.
activate the trigger. In that case, it can be done by calling
``dpkg-trigger --no-await /usr/lib/mime/packages`` from the
maintainer script after creating, modifying, or removing the file.
+
+.. index::
+ pair: signaling; reboot
+
+.. _s-signalingreboot
+
+Signaling that a reboot is required
+-----------------------------------
+
+.. index::
+ single: reboot-required
+ single: reboot-required.pkgs
+
+Programs can signal that a reboot is required by ``touch``\ing
+``/run/reboot-required``. It is conventional to add the name of the
+package(s) requiring the reboot to
+``/run/reboot-required.pkgs``. Programs should not add a package name
+to ``/run/reboot-required.pkgs`` if it is already present there.
+
+.. index:
+ single: postinst
+
+The ``/run/reboot-required`` mechanism is used when a reboot is
+needed to fully apply the changes introduced by package
+installation or upgrade. Typically it is the ``postinst``
+maintainer script that touches ``/run/reboot-required``, at the end
+of a successful configuration of the package.
+
+There are no guarantees provided by the ``/var/reboot-required``
+convention as to when or whether the requested reboot will occur.
Reply to: