Missing non-"unit" properties (e.g. service)
phemmer opened this issue · 1 comments
For service (and presumably other) unit types, some property updates are being missed when using SetPropertiesSubscriber
. This is happening because they are being sent across D-Bus with interface org.freedesktop.systemd1.Service
, and the code is discarding everything other than org.freedesktop.systemd1.Unit
:
go-systemd/dbus/subscription.go
Lines 76 to 86 in f9f2546
For example, here's a snippet from dbus-monitor
:
signal time=1638238697.632552 sender=:1.0 -> destination=(null destination) serial=1589575 path=/org/freedesktop/systemd1/unit/test_4060_2eservice; interface=org.freedesktop.DBus.Properties; member=PropertiesChanged
string "org.freedesktop.systemd1.Service"
array [
dict entry(
string "MainPID"
variant uint32 0
)
dict entry(
string "ControlPID"
variant uint32 0
)
dict entry(
string "StatusText"
variant string ""
)
dict entry(
string "StatusErrno"
variant int32 0
)
dict entry(
string "Result"
variant string "success"
)
I'm not sure how you would prefer to handle this. Personally I'm inclined to remove the check on the interface. Let all properties get sent to the registered handler regardless of the interface. An Interface
field could be added to the PropertiesUpdate
struct to pass it along.
Closing. Have decided not to use go-systemd as it would require too many changes to work well.