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

Re: Bug#910377: Inhibit reboot/shutdown if dpkg is running

reopen 910377
reassign dpkg 1.20.9

On Sat, 31 Aug 2019 00:34:32 +0200 Michael Biebl <biebl@debian.org> wrote:

On Fri, 5 Oct 2018 21:30:43 +0200 Michael Biebl <biebl@debian.org> wrote:
> Am 05.10.18 um 21:28 schrieb Michael Biebl:
> > That said, also keep in mind, that the inhibit mechanism does not
> > if the reboot request is triggered by privileged users [1], e.g.
if you
> > trigger a reboot as root, an existing inhibitor blocks are ignored.
> > [1] https://github.com/systemd/systemd/issues/6644
> This issue describes this even better
> https://github.com/systemd/systemd/issues/2680

It seems there is no real interest to change this upstream and even if
at some point in the future there was a way to make inhibitors work for
the root user, I think such an inhibitor lock shoud be take directly by
dpkg. I don't think the hook interface is sufficient for that.

I'm reopening this issue and reassigning it dpkg package, that would at least avoid non privileged users to restart the machine when there is an update happening.

Apparently RPM has this functionality via a plugin. The manpage of the plugins available at [0] and says:

       This plugin for RPM prevents the system to enter shutdown, sleep
       or idle mode while there is a rpm transaction running to prevent
       system corruption that can occur if the transaction is
       interrupted by a reboot.

       This is achieved by using the inhibit DBUS interface of systemd.
       The call is roughly equivalent to executing

       systemd-inhibit --mode=block --what=idle:sleep:shutdown --who=RPM
       --why="Transaction running"

The code is available in [1]

Having something similar in dpkg would be nice, but that would mean that dpkg will grow a dependency on libdbus and/or libsystemd, not sure how that would work

[0] https://man7.org/linux/man-pages/man8/rpm-plugin-systemd-inhibit.8.html
[1] https://github.com/rpm-software-management/rpm/blob/master/plugins/systemd_inhibit.c

Reply to: