-
Notifications
You must be signed in to change notification settings - Fork 304
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dbus: Introduce GetAllProperties() for fetching all systemd unit properties #306
Conversation
Thanks for the PR! I'm currently away from my usual workstation; I'll give a look at this once I'm back |
ping |
Sorry for the long delay. I'm fine with adding this feature to the library. The only comment I have is that if the actual goal of the PR is to expose all-interfaces properties, I'd directly call this |
I've updated my PR accordingly. I hope I'm not missing anything obvious ;)
Nope. |
Great, thanks! Please just squash the commits, and I'll approve and merge. |
b195b5b
to
6b3e120
Compare
6b3e120
to
1b0c50b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
Thanks. Can you cut a new release? |
Yep, but I'd like to get #310 in first. It shouldn't take too long, I'll ping back here once done. |
Thanks! |
Hi,
I would like to fetch a bunch of systemd service unit properties (e.g. NRestarts, ActiveState, SubState, etc.) in a single call, similar to what I get by running
systemctl show <service>
.Currently,
dbus/methods.go
exposes two methods for retrieving unit properties:Both of these methods call the
getProperties()
helper method:getProperties()
will return a different set of properties depending on thedbusInterface
parameter value (i.e.org.freedesktop.systemd1.Unit
vsorg.freedesktop.systemd1.Service
). See thedbus-send
examples below that illustrate this:However, if we set the interface argument to an empty string, we get all of these properties in a single call:
I would like to be able to do the same using this lib by invoking something along the lines of
dbus.GetProperties("<MYSERVICE>.service", "")