Discussion:
Debian bookworm: reboot required
(too old to reply)
Klaus Singvogel
2024-02-12 10:50:01 UTC
Permalink
Hello,

in the past Debian Distributions there were two files in the system, when a reboot was necessary:
/run/reboot-required /run/reboot-required.pkgs

I installed today a new kernel under Debian Bookworm, which requires a reboot, but this system lacks of both files. They aren't present.

How can I find out, if there is a system reboot necessary, in a similar way, as it was possible in the past?

Thanks in advance.

Best regards,
Klaus.
--
Klaus Singvogel
GnuPG-Key-ID: 1024R/5068792D 1994-06-27
Andy Smith
2024-02-12 14:40:01 UTC
Permalink
Hi,
Post by Klaus Singvogel
/run/reboot-required /run/reboot-required.pkgs
These files are created by the postinst script of individual Debian
packages. See for example the output of:

$ grep reboot-required /var/lib/dpkg/info/*
Post by Klaus Singvogel
I installed today a new kernel under Debian Bookworm, which
requires a reboot, but this system lacks of both files. They
aren't present.
None of my kernel-related packages have a postinst that creates
these files, so I'm not sure that installing a kernel package has
ever done that.

I think if you install the unattended-upgrades package it will
create those files after a kernel upgrade. I do not use that, which
is why I see nothing cresting those files. Perhaps you have that
installed elsewhere but not on this machine.
Post by Klaus Singvogel
How can I find out, if there is a system reboot necessary, in a
similar way, as it was possible in the past?
Are you thinking of update-notifier-common which used to be installed
by default but was removed entirely in Debian jessie? An approximate
replacement for this is the package "reboot-notifier".

On the same theme there is also "needrestart" which will tell you
which daemons need to be restarted after libraries have been
upgraded.

Thanks,
Andy
--
https://bitfolk.com/ -- No-nonsense VPS hosting
Klaus Singvogel
2024-02-12 15:20:01 UTC
Permalink
Hi Andy,

thanks for your helpful response.
Post by Andy Smith
These files are created by the postinst script of individual Debian
$ grep reboot-required /var/lib/dpkg/info/*
On my Debian Bullseye machine, where I got also a new kernel, I see this:

# grep -l reboot-required /var/lib/dpkg/info/*
/var/lib/dpkg/info/dbus.postinst
/var/lib/dpkg/info/evolution-data-server.postinst
/var/lib/dpkg/info/gnome-shell.postinst

→ no kernel package.

But on this machine the content of reboot-required.pkgs is today (after I got a new kernel):

# cat /var/run/reboot-required.pkgs
linux-image-5.10.0-28-amd64

So I doubt, that the file is only (!) created by /var/lib/dpkg/info/*, as the grep lacks of this output: linux-image.postinst

[...]
Post by Andy Smith
None of my kernel-related packages have a postinst that creates
these files, so I'm not sure that installing a kernel package has
ever done that.
Agreed.
Post by Andy Smith
I think if you install the unattended-upgrades package it will
create those files after a kernel upgrade. I do not use that, which
is why I see nothing cresting those files. Perhaps you have that
installed elsewhere but not on this machine.
Yes! This was a good pointer. Indeed the unattended-upgrades was installed on my Bullseye host, but not on my Bookworm host.
Post by Andy Smith
Are you thinking of update-notifier-common which used to be installed
by default but was removed entirely in Debian jessie? An approximate
replacement for this is the package "reboot-notifier".
I'm not searching for kind of notifier, instead I want to lookup the reboot by my own (shell) script, like via existance of a file.

I'll install unattended-upgrades now, and will see, if it helps at next kernel installation.

Thanks for your help. Great job.

Best regards,
Klaus.
--
Klaus Singvogel
GnuPG-Key-ID: 1024R/5068792D 1994-06-27
Dan Ritter
2024-02-12 15:40:01 UTC
Permalink
Post by Klaus Singvogel
I'm not searching for kind of notifier, instead I want to lookup the reboot by my own (shell) script, like via existance of a file.
I'll install unattended-upgrades now, and will see, if it helps at next kernel installation.
I will note that while unattended-upgrades can be quite useful,
most individual users and small installations -- in my
experience -- prefer the default policy of apticron, which is to
download upgraded packages and send a mail notification, rather
than to install them automatically.

-dsr-

Loading...