From 40e00423a8de7a4bec5a97bc2e08a8dfd1517ad6 Mon Sep 17 00:00:00 2001 From: Veiko Aasa Date: Sat, 28 Dec 2024 14:44:06 +0200 Subject: [PATCH] users: Restart nslcd service after configuration changes during setup Fixes an issue where the nslcd configuration option pam_authz_search is not in effect after the users module setup. Tests: - Remove the pam_authz_search configuration option from /etc/nslcd.conf, restart nslcd service, delete plinth.sqlite database to run first setup after plinth start, start plinth. Do it twice: 1) before applying patch, users::test_user_states functional test fails. 2) after applying patch, users::test_user_states functional test pass. - After applying patch, the nslcd service is restarted during module upgrade. - All the users module tests pass. Relates to https://salsa.debian.org/freedombox-team/freedombox/-/merge_requests/2594#note_565614. Signed-off-by: Veiko Aasa Reviewed-by: Sunil Mohan Adapa --- plinth/modules/users/__init__.py | 2 +- plinth/modules/users/privileged.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/plinth/modules/users/__init__.py b/plinth/modules/users/__init__.py index 4c446a767..528d6e426 100644 --- a/plinth/modules/users/__init__.py +++ b/plinth/modules/users/__init__.py @@ -47,7 +47,7 @@ class UsersApp(app_module.App): app_id = 'users' - _version = 7 + _version = 8 can_be_disabled = False diff --git a/plinth/modules/users/privileged.py b/plinth/modules/users/privileged.py index f672b8282..3d75043ca 100644 --- a/plinth/modules/users/privileged.py +++ b/plinth/modules/users/privileged.py @@ -124,7 +124,8 @@ def _configure_ldap_authentication(): action_utils.service_enable('slapd') action_utils.service_start('slapd') action_utils.service_enable('nslcd') - action_utils.service_start('nslcd') + # For changes in /etc/nslcd.conf to take effect, restart the service + action_utils.service_restart('nslcd') def _configure_ldap_structure():