systemd_util
Utilities for interacting with systemd units.
Functions:
-
does_unit_exist–Check if a systemd unit is defined and loaded. This does not check if the unit is running.
-
get_command_line–Read the command line arguments for a process from /proc/[pid]/cmdline.
-
get_unit_pid–For a running systemd unit, return the PID of the main process. Otherwise, return None.
-
get_unit_property–Return the value of a property of a systemd unit.
does_unit_exist
get_command_line
get_unit_pid
get_unit_property
Return the value of a property of a systemd unit.
Parameters:
-
unit_name(str) –The name of the systemd unit to get the property of.
-
property_name(str) –The name of the property to get the value of.
Raises:
-
KeyError–If the property is not found for the unit.
Returns:
-
str–The value of the property.