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

Bug#919507: Reboot required patch for Debian policy



On Sat, 19 Jan 2019 11:10:09 -0700
Sean Whitton <spwhitton@spwhitton.name> wrote:

> On Fri 18 Jan 2019 at 12:04PM -0600, Karl O. Pinc wrote:

> > +Maintainer scripts can signal that a reboot is required to fully
> > apply +the changes to the system by touching
> > ``/run/reboot-required`` and +adding the package name to
> > ``/run/reboot-required.pkgs``. Maintainer +scripts should not add
> > the package name to +``/run/reboot-required.pkgs`` if it is already
> > present there.  
> 
> Are you sure that adding the package name to the .pkgs file is
> required? I've not seen that file on my system; it seems that only
> /run/reboot-required is used.  Balint said that the .pkgs is an Ubuntu
> thing; are you sure it has been upstreamed into Debian?

Yes:
https://sources.debian.org/src/unattended-upgrades/1.9/kernel/postinst.d/unattended-upgrades/#L10

I can't say what's _required_.  I'm following Balint's wording.

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.
But see:
 https://codesearch.debian.net/search?q=run%2Freboot-required.pkgs

(Returns:
 lynis, unattended-upgrades, hobbit-plugins, reboot-notifier, kubernetes
)

I am adding some wording about the purpose of reboot-required.pkgs,
based on the results of the above search.

I'm also adding wording which says that the OS may or may not
actually reboot.

> > +
> > +The appropriate place to do this is expected to be when the
> > +``postinst`` script is called as ``postinst configure
> > +most-recently-configured-version``.
> > +
> > +Ordinary programs may manipulate these files to signal that a
> > reboot +is required.
> > +  
> 
> This is a bit awkward.  You describe this feature in terms of
> maintainer scripts and then say that programs can use it too.  It
> would be better to put it in ch. 9 or ch. 10, I think, and describe
> it in more general terms.

All right.  I'll put it in ch 9 at the bottom.  I think it belongs
there _and_ it won't mess with section numbering.

(I had had it in the middle of chapter 6 because it seemed
an appropriate place -- before all the details.)

Attached is reboot_required_v4.patch

Regards,

Karl <kop@meme.com>
Free Software:  "You don't pay back, you pay forward."
                 -- Robert A. Heinlein

P.S.  Never changing section numbering seems a hard row to hoe.

diff --git a/policy/ch-opersys.rst b/policy/ch-opersys.rst
index 59c92ec..78d3136 100644
--- a/policy/ch-opersys.rst
+++ b/policy/ch-opersys.rst
@@ -1040,3 +1040,39 @@ 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``.  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.
+
+.. index:
+   single: postinst
+
+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.
+
+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.
+
+

Reply to: