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

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



On Wed, May 19, 2021 at 04:03:16PM +0200, Laurent Bigonville wrote:
> reopen 910377
> reassign dpkg 1.20.9
> thanks
> 
> 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
> work
> > > > 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

Or just use apt which already does this instead of manually running
dpkg? I mean, it wouldn't hurt to have dpkg inhibit too, but it's not
really relevant for most users given that apt-pkg library does and hence
apt, aptitude, packagekit.

-- 
debian developer - deb.li/jak | jak-linux.org - free software dev
ubuntu core developer                              i speak de, en


Reply to: