On 02/04/2017 10:09 PM, Muri Nicanor wrote: > i just found a bug (#854192) in the installation procedure of usbguard: > when i install usbguard on a minimal stretch system, the installation > stalls and never ends successfully. apparently it has something to do > with dbus being a dependency of usbguard. if i install dbus *before* > installing usbugard, everything works fine. this is probably, why it > didn't come up before. if i don't, the installations procedure stalls at >> /var/lib/dpkg/info/usbguard.postinst configure > > and the journal says >> Feb 04 13:11:04 debian dbus-daemon[1200]: Unknown username >> "usbguard-dbus" in message bus configuration file >> Feb 04 13:11:04 debian dbus-daemon[1200]: Failed to start message >> bus: Could not get UID and GID for username "messagebus"
Problem is that DBus fails to start, and systemd requires DBus to be running (and configured properly) if Type=dbus is used. The problem is that your package doesn't have Depends: dbus, so it doesn't depend on the DBus daemon being available, so APT configures dbus after usbguard (it's allowed to do that w/o an explicit Depends), which is bad, since dbus's postinst creates the 'messagebus' user, without which the DBus daemon doesn't start. Fix is simple: add that dependency. :-) If you look at other DBus services, they all have that dependency explicitly. That said: I just tried this in a VM, and systemd appears to be quite broken if you try to start a Type=dbus unit when DBus is installed, but not properly configured. And while that is not normally the case, I couldn't get systemd to work properly again without rebooting it, not even a daemon-reexec worked. So I think this would also qualify as a systemd bug here - it should just fail the Type=dbus unit at this point, and not go into an endless loop. I'll report that separately. Regards, Christian