Re: How to manually trigger a bus-activated service?

Ross Boylan <[email protected]> Tue, 11 Feb 2025 13:20:23 -0800
Newsgroups gmane.comp.freedesktop.dbus
Message-ID <CAK3NTRD-f7fSaDvKGsPD0L=qmvUY5JBhOYuS5mQsOLE6wLgfmw@mail.gmail.com>
On Tue, Feb 11, 2025 at 8:32=E2=80=AFAM Robert Middleton
<[email protected]> 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=3Doneshot 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@barley:~# date; dbus-send --system --print-reply
--dest=3Dboylan.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=3D"method_call", sender=3D":1.2168" (uid=3D0
pid=3D208979 comm=3D"dbus-send --system --print-reply --dest=3Dboylan.ros")
interface=3D"org.freedesktop.DBus.Introspectable" member=3D"Introspect"
error name=3D"(unset)" requested_reply=3D"0"
destination=3D"boylan.ross.remotebackup" (bus)

The first part of the response looks like a permission problem, though
I'm not sure what the `error name=3D"(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@barley:~# date; dbus-send --system --print-reply
--dest=3Dboylan.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@barley:~# date; dbus-send --system --print-reply
--dest=3Dboylan.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