#852108 usbguard.service is started three times on initial installation and only the 3rd time succeeds

Package:
usbguard
Source:
usbguard
Description:
USB device authorization policy framework
Submitter:
Date:
2026-09-26 22:07:04 UTC
Severity:
normal
Tags:
#852108#5
Date:
2017-01-21 18:08:52 UTC
From:
To:
Package: usbguard
Version: 0.6.2+ds1-1
Severity: normal

Hi,

after installing the package, usbguard.service fails to start:

  systemd[1]: Started USBGuard daemon.
  usbguard-daemon[30357]: [1485021770.799] (E) ERROR: Configuration: /etc/usbguard/rules.conf: usbguard::Exception
  systemd[1]: usbguard.service: Main process exited, code=exited, status=1/FAILURE
  systemd[1]: usbguard.service: Unit entered failed state.
  systemd[1]: usbguard.service: Failed with result 'exit-code'.

It looks like the default config depends on a file that doesn't exist
(yet). Any reason why we should not create an empty rules.conf in
postinst if there's none (and remove it on purge)?

Cheers,

#852108#10
Date:
2017-01-24 14:56:54 UTC
From:
To:
control: tags -1 + pending

Hi intrigeri,

thanks a lot for spotting this. You're totally right, there should be at
least an empty rules.conf file. I'll fix that.

cheers,
muri

#852108#17
Date:
2017-02-04 17:53:11 UTC
From:
To:
control: tags -1 + moreinfo unreproducible

hi again,

i'm actually not able to reproduce the bug. if i install usbguard on a
clean stretch installation i can start usbguard[0] without having an
/etc/usbguard/rules.conf file:

was there maybe a file without read permissions? or with maybe with
rules that made usbguard choke?

(nontheless i'll still add the rules.conf in the postinst script)

cheers,
muri

[0] i found another bug, that i'll file right away

#852108#24
Date:
2017-02-07 10:49:30 UTC
From:
To:
Hi,

Muri Nicanor:
installation is weird: usbguard.service is started no less than
3 times, and only the third attempt works. It looks somewhat related
to usbguard-dbus.service:

Feb 07 11:38:41 sid-desktop systemd[1]: Started USBGuard daemon.
Feb 07 11:38:41 sid-desktop systemd[1]: Starting USBGuard D-Bus Service...
Feb 07 11:38:41 sid-desktop usbguard-daemon[3693]: [1486463921.919] (E) ERROR: Configuration: /etc/usbguard/rules.conf: usbguard::Exception
Feb 07 11:38:41 sid-desktop systemd[1]: usbguard.service: Main process exited, code=exited, status=1/FAILURE
Feb 07 11:38:41 sid-desktop systemd[1]: usbguard.service: Unit entered failed state.
Feb 07 11:38:41 sid-desktop systemd[1]: usbguard.service: Failed with result 'exit-code'.
Feb 07 11:38:41 sid-desktop systemd[1]: Started USBGuard D-Bus Service.
Feb 07 11:38:42 sid-desktop systemd[1]: usbguard.service: Service hold-off time over, scheduling restart.
Feb 07 11:38:42 sid-desktop systemd[1]: Stopped USBGuard daemon.
Feb 07 11:38:42 sid-desktop systemd[1]: Started USBGuard daemon.
Feb 07 11:38:42 sid-desktop systemd[1]: Stopping USBGuard D-Bus Service...
Feb 07 11:38:42 sid-desktop systemd[1]: Stopped USBGuard D-Bus Service.
Feb 07 11:38:42 sid-desktop systemd[1]: Starting USBGuard D-Bus Service...
Feb 07 11:38:42 sid-desktop usbguard-daemon[3704]: [1486463922.084] (E) ERROR: Configuration: /etc/usbguard/rules.conf: usbguard::Exception
Feb 07 11:38:42 sid-desktop systemd[1]: usbguard.service: Main process exited, code=exited, status=1/FAILURE
Feb 07 11:38:42 sid-desktop systemd[1]: usbguard.service: Unit entered failed state.
Feb 07 11:38:42 sid-desktop systemd[1]: usbguard.service: Failed with result 'exit-code'.
Feb 07 11:38:42 sid-desktop systemd[1]: Started USBGuard D-Bus Service.
Feb 07 11:38:42 sid-desktop systemd[1]: usbguard.service: Service hold-off time over, scheduling restart.
Feb 07 11:38:42 sid-desktop systemd[1]: Stopping USBGuard D-Bus Service...
Feb 07 11:38:42 sid-desktop systemd[1]: Stopped USBGuard daemon.
Feb 07 11:38:42 sid-desktop systemd[1]: Started USBGuard daemon.
Feb 07 11:38:42 sid-desktop systemd[1]: Stopped USBGuard D-Bus Service.
Feb 07 11:38:42 sid-desktop systemd[1]: Starting USBGuard D-Bus Service...
Feb 07 11:38:42 sid-desktop systemd[1]: Started USBGuard D-Bus Service.

So in the end the service is started successfully, but still I wonder
if this strange behavior is highlighting something wrong somewhere
deeper, that could bite us in the future.

Retitling accordingly. Feel free to downgrade severity.

Sounds good!

Cheers,

#852108#33
Date:
2019-12-18 12:28:19 UTC
From:
To:
Hello,

Thanks for your work on this package! This bug has the 'pending' tag
since January 24, 2017. Maybe the fix is not pending anymore?

Thanks & regards

#852108#38
Date:
2020-01-01 14:51:24 UTC
From:
To:
control: tags -1 - pending

Hi,

Thanks for noticing! Yes, the fix about the missing rules.conf is not
pending anymore.

cheers,
Birger

#852108#45
Date:
2026-09-26 22:05:32 UTC
From:
To:
close 852108 1.1.4+ds-7
thanks

Hi intrigeri,

thank you for your report. I've checked it with the current version from
sid, and I can't reproduce it - as far as I can see, usbguard is only
started once.

If contrary to that, you can reproduce it, please feel free to reopen
the bug.

Regards,
Daniel

#852108#54
Date:
2026-09-26 22:05:32 UTC
From:
To:
close 852108 1.1.4+ds-7
thanks

Hi intrigeri,

thank you for your report. I've checked it with the current version from
sid, and I can't reproduce it - as far as I can see, usbguard is only
started once.

If contrary to that, you can reproduce it, please feel free to reopen
the bug.

Regards,
Daniel