Closed dabcoder closed 3 years ago
nope you are doing it right, here is my output
In [1]: c = pystemd.systemd1.Unit('crond.service', _autoload=True)
In [2]: c.Service.GetProcesses()
Out[2]:
[(b'/system.slice/crond.service',
26869,
b'/usr/sbin/crond -n -m/usr/us/ops/scripts/mailops/cron_output_handler'),
...
...
(b'/system.slice/crond.service', 1696433, b'/bin/sleep 282')]
Does GetProcesses exists in your version of systemd?, you can try to introspect the bus object (using busctl) to find if GetProcesses exists..
what version of systemd are you running?
what version of systemd are you running?
systemctl --version
systemd 237
busctl list
doesn't give any indications with regards to GetProcesses. Is it due to a systemd version issue?
@aleivag I kept looking into this but given that GetProcesses
does not exist in some less recent versions of systemd, would it make sense to add a quick comment in the README to clarify this point (I can issue a PR for that if so)?
I also tried unsuccessfully to use busctl
to gather more info, so if you have any more specific info to share on this topic, that'd be great (can also include that info in the README if it makes sense to add it).
Thanks!
GetProcesses was added in systemd/systemd@291d565a github says its in the v230 tag ...
oh it's "GetUnitProcesses"
looks like GetProcesses wasn't allowed until v238 by https://github.com/systemd/systemd/commit/a6011d1887f30867c8e8236605fdb2bbd2c386a5
Thanks for following up on that. I can issue a PR to add this as a comment in the README maybe.
Closing as the PR was merged.
I am getting:
Am I missing anything there?