Recently, I’ve been working on adding support for bus activated D-Bus services, and noticed that the existing systemd code supported
dbus as a daemon type.
This generates a systemd
.service file using
Type=dbus, where the service is considered to have finished starting when it registers a particular well known name on the message bus. I imagine this is the mode most snapped D-Bus services would want to use.
However, Snapcraft complains that
dbus is not a valid value for the
daemon attribute on an app. I was able to build a snap using
passthrough with something like this:
apps: system: command: ... passthrough: daemon: dbus bus-name: io.snapcraft.SnapDbusService
This produced a working snap with the right mode in the systemd unit, but it looks like review-tools also trips up on
dbus type daemons:
$ review-tools.snap-review test-snapd-dbus-service_1.0_amd64.snap Errors ------ ... - lint-snap-v2:daemon:system invalid daemon: 'dbus' Warnings -------- - lint-snap-v2:apps_unknown:system unknown fields for app 'system': 'bus-name'
Is this just an oversight, or is there a particular reason to discourage use of this daemon type?