libnss-ldap default runlevels cause invoke-rc.d to fail

Bug #1739832 reported by xennex82
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
libnss-ldap (Ubuntu)
New
Undecided
Unassigned

Bug Description

During postinst invoke-rc.d libnss-ldap start is run.

libnss-ldap comes without any Default-Start levels

On line 390 of invoke-rc.d:

### LOCAL INITSCRIPT POLICY: Enforce need of a start entry
### in either runlevel S or current runlevel to allow start
### or restart.
###
case ${ACTION} in
  start|restart)
    if testexec ${SLINK} ; then
    RC=104
    elif testexec ${KLINK} ; then
    RC=101
    elif testexec ${SSLINK} ; then
    RC=104
    else
        RC=101
    fi
  ;;
esac

Therefore, the (now generated) systemd service is not started.

This causes it to not execute its "Stop" action during shutdown, causing the system to fail booting because nssldap-update-ignoreusers is not run.

Possible remedies:

--- libnss-ldap.orig 2016-10-06 15:42:27.991990056 +0200
+++ libnss-ldap 2016-10-06 15:45:48.921305843 +0200
@@ -6,4 +6,4 @@
 # Required-Stop: mountall.sh
-# Default-Start:
-# Default-Stop: 0 1 6
+# Default-Start: 1 2 5
+# Default-Stop: 0 6
 # Short-Description: Updates /etc/ldap.conf

The "5" is essential as noted above in update-rc.d.

Runlevels 1, 2 and 5 are translated to rescue, multiuser and graphical.target

By enabling this patch and then running:

update-rc.d libnss-ldap remove
update-rc.d libnss-ldap defaults
invoke-rc.d libnss-ldap start

The systemd service is now started:

dec 22 21:55:26 ubuntu systemd[1]: Starting LSB: Updates /etc/ldap.conf...
dec 22 21:55:26 ubuntu systemd[1]: Started LSB: Updates /etc/ldap.conf.

Whereas before nothing would happen.

Alternatively a systemd service could be added, along the lines of:

[Unit]
Description=Ensure LDAP does not prevent the system from booting

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStop=/usr/sbin/nssldap-update-ignoreusers

[Install]
WantedBy=multi-user.target rescue.target

--------------------------------------
Description: Ubuntu 16.04.3 LTS
Release: 16.04
--------------------------------------
libnss-ldap:
  Installed: 265-3ubuntu2
  Candidate: 265-3ubuntu2
  Version table:
 *** 265-3ubuntu2 500
        500 http://nl.archive.ubuntu.com/ubuntu xenial/universe amd64 Packages
        100 /var/lib/dpkg/status
--------------------------------------

Related to: https://bugs.launchpad.net/ubuntu/+source/libnss-ldap/+bug/1024475

Revision history for this message
xennex82 (xennex82) wrote :
Revision history for this message
xennex82 (xennex82) wrote :

Please close this one (and delete).

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.