feat(dbus): Add avahi-daemon configuration to system services
Introduce a `configure_avahi_daemon` function to manage the avahi-daemon service and socket with proper post actions. Update the interface configuration to enable avahi management using the new function.
This commit is contained in:
@@ -93,6 +93,18 @@ class RevPiConfig:
|
||||
return self._cm_with_wifi
|
||||
|
||||
|
||||
def configure_avahi_daemon(action: ConfigActions):
|
||||
return_value = simple_systemd(action, "avahi-daemon.service")
|
||||
|
||||
# Post actions for avahi-daemon
|
||||
if action in (ConfigActions.ENABLE, ConfigActions.DISABLE):
|
||||
# Apply the enable/disable action to the avahi socket AFTER the service
|
||||
# unit, because a connected socket could interrupt stop
|
||||
simple_systemd(action, "avahi-daemon.socket")
|
||||
|
||||
return return_value
|
||||
|
||||
|
||||
def configure_gui(action: ConfigActions):
|
||||
gui_available = access("/usr/bin/startx", X_OK)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user