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

Unit command throws exception when on embedded system #8

Description

@jfmorneau

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'.)
>>>

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions