Skip to content

Commit bc17057

Browse files
author
Alexey Baranov
committed
add method to get service property
1 parent f0fc421 commit bc17057

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

dbus/methods.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,11 @@ func (c *Conn) GetUnitProperty(unit string, propertyName string) (*Property, err
199199
return c.getProperty(unit, "org.freedesktop.systemd1.Unit", propertyName)
200200
}
201201

202+
// GetServiceProperty returns property for given service name and property name
203+
func (c *Conn) GetServiceProperty(service string, propertyName string) (*Property, error) {
204+
return c.getProperty(service, "org.freedesktop.systemd1.Service", propertyName)
205+
}
206+
202207
// GetUnitTypeProperties returns the extra properties for a unit, specific to the unit type.
203208
// Valid values for unitType: Service, Socket, Target, Device, Mount, Automount, Snapshot, Timer, Swap, Path, Slice, Scope
204209
// return "dbus.Error: Unknown interface" if the unitType is not the correct type of the unit

0 commit comments

Comments
 (0)