From 2d963ec46116ded4287e7e8ba547c34118457832 Mon Sep 17 00:00:00 2001 From: Veiko Aasa Date: Fri, 3 Apr 2020 13:17:48 +0300 Subject: [PATCH] users: Try-restart service after service is added to the sharing group Try-restart the service (instead of restart) after adding service to the freedombox-share group to avoid starting the service if app is disabled. Tests performed: - Remove syncthing user from the freedombox-share group, disable syncthing app, increase app version. After the app is upgraded, verify that syncthing user is in the freedombox-share group and syncthing@syncthing.service remains disabled. - Remove syncthing user from the freedombox-share group, enable syncthing app, increase app version. After the app is upgraded, verify that syncthing user is in the freedombox-share group and logs show that syncthing@syncthing.service was restarted. Signed-off-by: Veiko Aasa Reviewed-by: Sunil Mohan Adapa --- plinth/modules/users/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plinth/modules/users/__init__.py b/plinth/modules/users/__init__.py index ddb27f584..987b51dec 100644 --- a/plinth/modules/users/__init__.py +++ b/plinth/modules/users/__init__.py @@ -155,4 +155,4 @@ def add_user_to_share_group(username, service=None): actions.superuser_run( 'users', ['add-user-to-group', username, 'freedombox-share']) if service: - actions.superuser_run('service', ['restart', service]) + actions.superuser_run('service', ['try-restart', service])