From c30b3eb85ca9334ab92809722d78bd7667ea9c75 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Tue, 20 Aug 2019 09:16:06 -0700 Subject: [PATCH] cockpit: Apply domain name changes immediately Without restarting cockpit, newly added/removed domain in cockpit configuration file do not immediately work. Either the daemon has to stop itself due to inactivity (it is socket activated by systemd) or system needs to be restarted. Without the patch, if cockpit is not currently running (due to socket activation not having happened yet) the domain name changes would be noticeable immediately. Signed-off-by: Sunil Mohan Adapa Reviewed-by: James Valleroy --- plinth/modules/cockpit/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plinth/modules/cockpit/__init__.py b/plinth/modules/cockpit/__init__.py index ee08955d7..2d55c7e6d 100644 --- a/plinth/modules/cockpit/__init__.py +++ b/plinth/modules/cockpit/__init__.py @@ -132,6 +132,7 @@ def on_domain_added(sender, domain_type, name, description='', services=None, setup_helper = globals()['setup_helper'] if setup_helper.get_state() != 'needs-setup': actions.superuser_run('cockpit', ['add-domain', name]) + actions.superuser_run('service', ['try-restart', managed_services[0]]) def on_domain_removed(sender, domain_type, name, **kwargs): @@ -139,3 +140,4 @@ def on_domain_removed(sender, domain_type, name, **kwargs): setup_helper = globals()['setup_helper'] if setup_helper.get_state() != 'needs-setup': actions.superuser_run('cockpit', ['remove-domain', name]) + actions.superuser_run('service', ['try-restart', managed_services[0]])