bus1 / dbus-broker

Linux D-Bus Message Broker
https://github.com/bus1/dbus-broker/wiki
Apache License 2.0
685 stars 84 forks source link

launcher: allow searching for system-services in /etc/ and /run/ #378

Closed bluca closed 1 month ago

bluca commented 2 months ago

This is useful when an asset manager wants to install a system service while /usr/ is read-only (e.g.: local system services running on a different namespaced image)

spec and dbus-daemon corresponding change: https://gitlab.freedesktop.org/dbus/dbus/-/merge_requests/467

dvdhrm commented 2 months ago

Thanks! No objections from me!

Any consensus on whether to enable inotify-watches on the entry? And whether to enforce well-defined file-names for service entries there? I can wait merging these until they the discussion is settled. Personally, I agree with Smcv and we should not provide inotify-watches, but enforce well-defined file-names.

bluca commented 2 months ago

Yeah I am fine with not doing inotify and with strict enforcement, already updated as such in dbus-daemon, I'll check later how to do the same here and will update the PR accordingly. Thanks!

dvdhrm commented 2 months ago

We enforce strict names on the system bus for security reasons, but warn only on the user bus.

I think we unconditionally watch all service dirs, though. I think the reasoning was to be consistent, not entirely sure TBH.

So I think the patch is fine as is.

bluca commented 1 month ago

Ok no problem, I'll leave as-is then. We are adding /run/ as well in dbus-daemon, so added here as well.

bluca commented 1 month ago

https://gitlab.freedesktop.org/dbus/dbus/-/merge_requests/467

The dbus-daemon and spec side was merged just now

dvdhrm commented 1 month ago

/etc is higher priority than /run?

bluca commented 1 month ago

yes that's the case in systemd and everywhere else that uses this pattern - it is weird yes, but too ingrained to change now

dvdhrm commented 1 month ago

Thanks a lot!

Weird, I never noticed that /run isn't highest priority. So it is just a matter of time until we introduce /run/etc? :)

bluca commented 1 month ago

...or /etc/run/ !!