How to manually trigger a bus-activated service?

Ross Boylan rossboylan at stanfordalumni.org
Tue Feb 11 21:20:23 UTC 2025


On Tue, Feb 11, 2025 at 8:32 AM Robert Middleton
<robert.middleton at rm5248.com> wrote:
>
> Ross,
>
> At least part of the problem is that you have a - in the path.  Object
> paths can only consist of [A-Z][a-z][0-9]_.  If you replace the dash
> with an underscore that should let the activation work.
>
> As for the systemd stuff, possibly setting type=oneshot would mean
> that it would work as you intend.
>
> -Robert Middleton
>
Thanks for the advice.  The dbus spec is quite clear that names don't
include `-`; I thought it was OK because other files were using it,
and even the systemd.service man page's example of a dbus-activated
service features a dbus service with `-` in the name (:

I changed the dbus and systemd files.  I'm not sure what I need to do
to make the new values live, but the following experiment indicates
some awareness of them:
root at barley:~# date; dbus-send --system --print-reply
--dest=boylan.ross.remotebackup /boylan/ross/remotebackup
org.freedesktop.DBus.Introspectable.Introspect
Tue 11 Feb 2025 12:48:21 PM PST
Error org.freedesktop.DBus.Error.AccessDenied: Rejected send message,
1 matched rules; type="method_call", sender=":1.2168" (uid=0
pid=208979 comm="dbus-send --system --print-reply --dest=boylan.ros")
interface="org.freedesktop.DBus.Introspectable" member="Introspect"
error name="(unset)" requested_reply="0"
destination="boylan.ross.remotebackup" (bus)

The first part of the response looks like a permission problem, though
I'm not sure what the `error name="(unset)"` at the end is about; is
it telling me  that it is an error that the name is not set?

The proof of "some awareness" of my modified files is indirect: if I
send to  a different destination I get an error that the destination
is not provided by any .service file.  So it knows the destination
boylan.ross.remotebackup is provided by a .service file, even though I
didn't do anything explicit to load it.

root at barley:~# date; dbus-send --system --print-reply
--dest=boylan.ross.remotebackupxx /boylan/ross/remotebackup
org.freedesktop.DBus.Introspectable.Introspect
Tue 11 Feb 2025 12:50:17 PM PST
Error org.freedesktop.DBus.Error.ServiceUnknown: The name
boylan.ross.remotebackupxx was not provided by any .service files
root at barley:~# date; dbus-send --system --print-reply
--dest=boylan.ross /boylan/ross/remotebackup
org.freedesktop.DBus.Introspectable.Introspect
Tue 11 Feb 2025 12:50:35 PM PST
Error org.freedesktop.DBus.Error.ServiceUnknown: The name boylan.ross
was not provided by any .service files


More information about the dbus mailing list