diff options
author | Arthur de Jong <arthur@arthurdejong.org> | 2011-05-13 15:02:32 +0200 |
---|---|---|
committer | Arthur de Jong <arthur@arthurdejong.org> | 2011-05-13 15:02:32 +0200 |
commit | 9535c8f14a0fead97dd059f57898d3f74a145cc2 (patch) | |
tree | f96fc3cdfa3adadd6ac4009206092bda5adf6e27 /debian/libnss-ldapd.postinst | |
parent | fbeaf4fd5f08a2a60dcd05be81078aff621336af (diff) |
don't unconditionally restart nscd but just try to invalidate the cache for the maps that change
git-svn-id: http://arthurdejong.org/svn/nss-pam-ldapd/nss-pam-ldapd@1461 ef36b2f9-881f-0410-afb5-c4e39611909c
Diffstat (limited to 'debian/libnss-ldapd.postinst')
-rw-r--r-- | debian/libnss-ldapd.postinst | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/debian/libnss-ldapd.postinst b/debian/libnss-ldapd.postinst index 6124dd6..45d7f20 100644 --- a/debian/libnss-ldapd.postinst +++ b/debian/libnss-ldapd.postinst @@ -22,6 +22,8 @@ nss_enable() # append a new line printf '%-15s ldap\n' $name':' >> /etc/nsswitch.conf fi + # invalidate nscd cache + nscd -i "$name" > /dev/null 2>&1 || true fi # we're done return 0 @@ -46,6 +48,8 @@ nss_disable() # TODO: remove trailing space sed -i 's/^\('$name':.*\)ldap[[:space:]]*\(\[[^]]*\]\)*[[:space:]]*\(.*\)$/\1\3/' /etc/nsswitch.conf fi + # invalidate nscd cache + nscd -i "$name" > /dev/null 2>&1 || true fi # we're done return 0 @@ -70,17 +74,6 @@ then done # we're done db_stop - # restart nscd to pick up changes in nsswitch.conf - # (other processes will have to be restarted manually) - if [ -x /etc/init.d/nscd ] && [ `pidof -s nscd` ] - then - if which invoke-rc.d >/dev/null 2>&1 - then - invoke-rc.d nscd restart - else - /etc/init.d/nscd restart - fi - fi # update the cache of the dynamic linker # (we don't use dh_makeshlibs because that also installs a shlibs file # which we don't need) |