Skip to content

ignore UID 0 user instance

During package upgrades of a unit using deb-systemd-invoke --user restart foo.service in the postinst I was seeing output like this and a few seconds lag:

Failed to connect to user scope bus via machine transport: No medium found                                                                                                                                                                    
Failed to connect to user scope bus via machine transport: No medium found                                                                                                                                                                    
Failed to connect to user scope bus via machine transport: No medium found                                                                                                                                                                    
foo.service is a disabled or a static unit not running, not starting it.

I debugged this and was able to pin the root cause to deb-systemd-helper listing all user@* units, but during dpkg operations it includes user@0.service and the script fails to connect to that one via systemctl --user --machine 0@ for some reason.

This change skips the UID 0 unit when listing all currently running user units.

Merge request reports

Loading