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 <veiko17@disroot.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
Veiko Aasa authored and Sunil Mohan Adapa committed 2024-12-28 10:13:15 -08:00
1 parent 526c5354aa
commit 40e00423a8
2 files changed
+3 -2

No files matched your search

+1 -1
View File
@@ -47,7 +47,7 @@ class UsersApp(app_module.App):
app_id = 'users'
_version = 7
_version = 8
can_be_disabled = False
+2 -1
View File
@@ -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():