[Pkg-utopia-maintainers] Bug#1030154: polkitd: upgrade failure: usermod: user polkitd is currently used by process $pid

Simon McVittie smcv at debian.org
Tue Jan 31 17:01:05 GMT 2023


Package: polkitd
Version: 122-2
Severity: serious
Justification: maintainer says so
Tags: pending

While upgrading a bullseye GNOME system[1] to bookworm, I got this
upgrade failure:

> Setting up polkitd (122-2) ...
> Creating group 'polkitd' with GID 999.
> usermod: user polkitd is currently used by process 109547
> dpkg: error processing package polkitd (--configure):
>  installed polkitd package post-installation script subprocess returned error exit status 8

The root cause is that we are using `usermod -d /nonexistent polkitd`
to change the polkitd user's home directory from /var/lib/polkit-1 to
/nonexistent, to avoid junk directories like /var/lib/polkit-1/.cache
being created. However, usermod quite reasonably refuses to modify a
user while they have processes running.

I think there are two things we can do to avoid this:

- try to stop polkitd before we manipulate its system user;
- add a "|| true" to this usermod command because it could be restarted
  by D-Bus activation, but the usermod change isn't really critical for
  existing installations

and my inclination is to do both.

    smcv



More information about the Pkg-utopia-maintainers mailing list