Skip to content
This repository has been archived by the owner on Apr 6, 2021. It is now read-only.

Unit command throws exception when on embedded system #8

Open
jfmorneau opened this issue Jul 13, 2017 · 0 comments
Open

Unit command throws exception when on embedded system #8

jfmorneau opened this issue Jul 13, 2017 · 0 comments

Comments

@jfmorneau
Copy link

When running a command (start or stop), I sometimes get an exception. This happens on an ARM embedded system. I think that in my situation, the Job is already done when job = Job(job_path) is called. This might be because of the slower execution of the Python code on the embedded system.

In the example below, I don't get an exception when starting dnsmasq but I get one when stopping it (it takes longer to start dnsmasq than to stop it). I don't get exceptions when starting/stopping another service that takes longer to start/stop.

>>> manager.get_unit('dnsmasq.service').start('fail')
<systemd_dbus.job.Job object at 0xb647c890>
>>> manager.get_unit('dnsmasq.service').stop('fail')
ERROR:dbus.proxies:Introspect error on :1.0:/org/freedesktop/systemd1/job/2208: dbus.exceptions.DBusException: org.freedesktop.DBus.Error.UnknownObject: Unknown object '/org/freedesktop/systemd1/job/2208'.
Traceback (most recent call last):
  File "/usr/lib/python3.4/site-packages/systemd_dbus/unit.py", line 179, in stop
    job = Job(job_path)
  File "/usr/lib/python3.4/site-packages/systemd_dbus/job.py", line 48, in __init__
    self.__properties()
  File "/usr/lib/python3.4/site-packages/systemd_dbus/job.py", line 55, in __properties
    self.__interface.dbus_interface)
  File "/usr/lib/python3.4/site-packages/dbus/proxies.py", line 70, in __call__
    return self._proxy_method(*args, **keywords)
  File "/usr/lib/python3.4/site-packages/dbus/proxies.py", line 145, in __call__
    **keywords)
  File "/usr/lib/python3.4/site-packages/dbus/connection.py", line 651, in call_blocking
    message, timeout)
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.UnknownInterface: Unknown interface 'org.freedesktop.systemd1.Job'.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.4/site-packages/systemd_dbus/unit.py", line 182, in stop
    raise SystemdError(error)
systemd_dbus.exceptions.SystemdError: Error(Unknown interface 'org.freedesktop.systemd1.Job'.)
>>>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant