[Bug 1739833] [NEW] libnss-ldap default runlevels cause invoke-rc.d to fail
xennex82
ubuntu at xenhideout.nl
Fri Dec 22 21:35:55 UTC 2017
Public bug reported:
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
** Affects: libnss-ldap (Ubuntu)
Importance: Undecided
Status: New
** Patch added: "libnssldap_runlevel5.diff"
https://bugs.launchpad.net/bugs/1739833/+attachment/5026196/+files/libnssldap_runlevel5.diff
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to libnss-ldap in Ubuntu.
https://bugs.launchpad.net/bugs/1739833
Title:
libnss-ldap default runlevels cause invoke-rc.d to fail
Status in libnss-ldap package in Ubuntu:
New
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
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/libnss-ldap/+bug/1739833/+subscriptions
More information about the foundations-bugs
mailing list