You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to use systemd to manage a node.js service (finquick @@IOU link), and
I'd like something on my taskbar to tell me whether it's running. But I can't
figure out how to get the ListUnits dbus method to work on the SessionBus.
connolly@jambox:~$ dbus-send --print-reply --reply-timeout=2000 --type=method_call --dest=org.freedesktop.systemd1 /org/freedesktop/systemd1 org.freedesktop.systemd1.Manager.ListUnits
Error org.freedesktop.DBus.Error.Spawn.ChildExited: Process org.freedesktop.systemd1 exited with status 1
I started out using python Popen and systemctl --user status --all --output=json but --output=json doesn't apply to status of units; only to journal entries. In a Jun 2015 discussion, the systemd folks endorse DBus for this sort of thing.
python my_services_applet.py
Traceback (most recent call last):
File "my_services_applet.py", line 123, in <module>
_test1()
File "my_services_applet.py", line 55, in _test1
manager = systemd_manager(SessionBus())
File "my_services_applet.py", line 42, in systemd_manager
'/org/freedesktop/systemd1')
File "/usr/lib/python2.7/dist-packages/dbus/bus.py", line 241, in get_object
follow_name_owner_changes=follow_name_owner_changes)
...
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.Spawn.ChildExited: Process org.freedesktop.systemd1 exited with status 1
I'm trying to use systemd to manage a node.js service (finquick @@IOU link), and
I'd like something on my taskbar to tell me whether it's running. But I can't
figure out how to get the
ListUnits
dbus method to work on theSessionBus
.Works as expected:
fails:
I started out using python
Popen
andsystemctl --user status --all --output=json
but--output=json
doesn't apply to status of units; only to journal entries. In a Jun 2015 discussion, the systemd folks endorse DBus for this sort of thing.https://zignar.net/2014/09/08/getting-started-with-dbus-python-systemd/ works just fine, but only for the
SystemBus
. When I try theSessionBus
, I lose:systemd/systemd#5247 close, but arch (and Fedora?). I'm using Ubuntu.
The text was updated successfully, but these errors were encountered: