mirror of
https://github.com/freedombox/FreedomBox.git
synced 2026-01-28 08:03:36 +00:00
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 <sunil@medhas.org> Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
parent
393f4bbc26
commit
c30b3eb85c
@ -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]])
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user