Skip to content

Instantly share code, notes, and snippets.

@nohupped
Forked from anonymouse64/busctl-example-systemd.sh
Created February 15, 2023 10:44
Show Gist options
  • Save nohupped/ed0218849bd2c11d550c487b43c47d53 to your computer and use it in GitHub Desktop.
Save nohupped/ed0218849bd2c11d550c487b43c47d53 to your computer and use it in GitHub Desktop.
Get systemd unit property's from busctl
# Get the object path for a service with the "easy name"
sudo busctl --verbose --system call org.freedesktop.systemd1 /org/freedesktop/systemd1 org.freedesktop.systemd1.Manager GetUnit s snap.docker.dockerd.service
# get the ActiveState d-bus property of the Unit object
sudo busctl --verbose --system get-property org.freedesktop.systemd1 /org/freedesktop/systemd1/unit/snap_2edocker_2edockerd_2eservice org.freedesktop.systemd1.Unit ActiveState
# get the OOMScoreAdjust d-bus property of the Service object
sudo busctl --verbose --system get-property org.freedesktop.systemd1 /org/freedesktop/systemd1/unit/snap_2edocker_2edockerd_2eservice org.freedesktop.systemd1.Service OOMScoreAdjust
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment