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

Bug #1739833 reported by xennex82
14
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

Tags: patch
Revision history for this message
xennex82 (xennex82) wrote :
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "libnssldap_runlevel5.diff" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

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

Duplicates of this bug

Other bug subscribers

Remote bug watches

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