I've created a new systemd service that I would like to be able to active via a dbus call. The service simply executes a shell script.
I've defined the service here:
/lib/systemd/system/testamundo.service
[Unit]
Description=Testamundo
[Service]
Type=dbus
BusName=org.freedesktop.testamundo
ExecStart=/home/test/systemd/testamundo.sh
I've also defined a D-Bus service for it here:
/usr/share/dbus-1/system-services
[D-BUS Service]
Name=org.freedesktop.testamundo
Exec=/usr/sbin/console-kit-daemon --no-daemon
User=root
SystemdService=testamundo.service
I am attempting to start it using gdbus, this is the command I'm trying to use:
sudo gdbus call --system --dest org.freedesktop.systemd1 --object-path /org/freedesktop/systemd1 --method org.freedesktop.systemd1.StartUnit "org.freedesktop.testamundo"
If I use --system as I did above the command returns with an Unknown Method error, if I use --session it returns with an exit code 1 from the child process. When I look at journalctl with --session and --system I can see the command, but beyond that no additional information.
Appreciate any thoughts or advice, thanks!