libnss-ldap

Xen list at xenhideout.nl
Sat May 13 12:07:39 UTC 2017


Xen schreef op 13-05-2017 12:22:

> I thought earlier that this would be some error with update-rc.d.

I am sorry. Here is a rundown of the issue.

The postinst script for libnss-ldap calls invoke-rc.d start which would 
normally take care of part of the issue.

However the "local script policy" dictates that invoke-rc.d cannot be 
invoked on start actions for services that do not have start runlevels 
installed. Because this package has a default startlevel of (none) and 
only 3 stop levels (0 1 6) in its header inside the init script 
(/etc/init.d/libnss-ldap) invoke-rc.d will not do anything.

However it would be pointless to start it since this script only does 
someting on the stop action.

Regardless, without further ado it IS possible to start the script via 
systemd.

:

systemctl start libnss-ldap

just works.

The action is only performed on stop:

systemctl start libnss-ldap
systemctl stop libnss-ldap:

mei 13 13:51:29 ubuntu systemd[1]: Starting LSB: Updates 
/etc/ldap.conf...
mei 13 13:51:30 ubuntu libnss-ldap[9313]: Running
mei 13 13:51:30 ubuntu systemd[1]: Started LSB: Updates /etc/ldap.conf.
mei 13 13:51:30 ubuntu systemd[1]: Stopping LSB: Updates 
/etc/ldap.conf...
mei 13 13:51:30 ubuntu libnss-ldap[9322]: Running
mei 13 13:51:30 ubuntu libnss-ldap[9322]:  * Running 
nssldap-update-ignoreusers...
mei 13 13:51:30 ubuntu libnss-ldap[9322]:    ...done.
mei 13 13:51:30 ubuntu systemd[1]: Stopped LSB: Updates /etc/ldap.conf.

as intended.

It is simply impossible for the postinst script to trigger this without 
either directly calling systemctl or by first channging, in that sense, 
update-rc.d. However if we add default start runlevels to the header 
file:

# Default-Start:     2 3 4 5
# Default-Stop:      0 6

The invoke-rc.d policy check will not trigger a 101 and doing:

invoke-rc.d libnss-ldap start
invoke-rc.d libnss-ldap stop

would trigger the effect.




More information about the Ubuntu-devel-discuss mailing list