package nscd 2.11.1-0ubuntu7.2 failed to install/upgrade: subprocess installed post-installation script returned error exit status 1 due to initscript failing to start

Bug #652876 reported by biggie77
52
This bug affects 8 people
Affects Status Importance Assigned to Milestone
eglibc (Ubuntu)
Fix Released
Medium
Unassigned
Lucid
Won't Fix
Medium
Unassigned

Bug Description

Problem occurred after apt-get install, apt-get remove and again apt-get install of the following packages:

sudo apt-get install libpam-ldap libnss-ldap nss-updatedb libnss-db nfs-common nscd ldap-utils

Description: Ubuntu 10.04.1 LTS
Release: 10.04

nscd:
  Installed: 2.11.1-0ubuntu7.2
  Candidate: 2.11.1-0ubuntu7.2
  Version table:
 *** 2.11.1-0ubuntu7.2 0
        500 http://nl.archive.ubuntu.com/ubuntu/ lucid-updates/universe Packages
        100 /var/lib/dpkg/status
     2.11.1-0ubuntu7.1 0
        500 http://security.ubuntu.com/ubuntu/ lucid-security/universe Packages

Not sure if it is working correctly or not, it gave an error message, so...?
     2.11.1-0ubuntu7 0
        500 http://nl.archive.ubuntu.com/ubuntu/ lucid/universe Packages

ProblemType: Package
DistroRelease: Ubuntu 10.04
Package: nscd 2.11.1-0ubuntu7.2
ProcVersionSignature: Ubuntu 2.6.32-25.44-server 2.6.32.21+drm33.7
Uname: Linux 2.6.32-25-server x86_64
Architecture: amd64
Date: Fri Oct 1 12:22:27 2010
ErrorMessage: subprocess installed post-installation script returned error exit status 1
InstallationMedia: Custom Live CD - Release amd64
SourcePackage: eglibc
Title: package nscd 2.11.1-0ubuntu7.2 failed to install/upgrade: subprocess installed post-installation script returned error exit status 1

Revision history for this message
biggie77 (noordwijk) wrote :
Revision history for this message
Ian Gordon (ian-gordon+launchpad) wrote :

Installing (using apt-get upgrade) new versions of nscd always fail with the error

Setting up nscd (2.11.1-0ubuntu7.5) ...
 * Starting Name Service Cache Daemon nscd [fail]
invoke-rc.d: initscript nscd, action "start" failed.
dpkg: error processing nscd (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 nscd
E: Sub-process /usr/bin/dpkg returned an error code (1)

The source of the problem is that the postinst script always attempts to do a start of the service.
Unfortunately the start code in /etc/init.d/nscd does not quite do the right thing when nscd is already running.

start_ncsd function need to be changed to something more like this:

start_nscd()
{
        # Return
        # 0 if daemon has been started
        # 1 if daemon was already running
        # 2 if daemon could not be started
        start-stop-daemon --start --quiet --pidfile "$PIDFILE" --exec "$DAEMON"
        RETVAL="$?"
        [ "$RETVAL" -ne 0 -a "$RETVAL" -ne 1 ] && return 2
        return "$RETVAL"
}

instead of
start_nscd()
{
        # Return
        # 0 if daemon has been started or was already running
        # 2 if daemon could not be started
        start-stop-daemon --start --quiet --pidfile "$PIDFILE" --exec "$DAEMON" || return 2
}

Revision history for this message
Brian Murray (brian-murray) wrote :

This is the way the daemon behaves in Oneiric at least.

start_nscd()
{
        # Return
        # 0 if daemon has been started or was already running
        # 2 if daemon could not be started
        start-stop-daemon --start --quiet --pidfile "$PIDFILE" --exec "$DAEMON" --test > /dev/null || return 0
        start-stop-daemon --start --quiet --pidfile "$PIDFILE" --exec "$DAEMON" || return 2
}

Revision history for this message
Brian Murray (brian-murray) wrote :
Revision history for this message
Brian Murray (brian-murray) wrote :
Revision history for this message
Brian Murray (brian-murray) wrote :

Okay further testing of installing nscd and then using service nscd start in a chroot indicates that this only fixed in Oneiric.

Changed in eglibc (Ubuntu Lucid):
status: New → Triaged
importance: Undecided → Medium
Changed in eglibc (Ubuntu):
status: New → Fix Released
importance: Undecided → Medium
summary: package nscd 2.11.1-0ubuntu7.2 failed to install/upgrade: subprocess
- installed post-installation script returned error exit status 1
+ installed post-installation script returned error exit status 1 due to
+ initscript failing to start
Revision history for this message
Etienne Goyer (etienne-goyer-outlands) wrote :

I cannot reproduce this bug. In my case, when upgrading, the nscd service is first stopped (see nscd.prerm) before being started again (in nscd.postinst), so the upgrade works just fine.

Witness:

ubuntu@lucid-server:~$ dpkg -l nscd
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Description
+++-=================================-=================================-==================================================================================
ii nscd 2.11.1-0ubuntu7 Embedded GNU C Library: Name Service Cache Daemon
ubuntu@lucid-server:~$ sudo apt-get install nscd
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be upgraded:
  nscd
1 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
Need to get 0B/212kB of archives.
After this operation, 4,096B of additional disk space will be used.
(Reading database ... 42122 files and directories currently installed.)
Preparing to replace nscd 2.11.1-0ubuntu7 (using .../nscd_2.11.1-0ubuntu7.10_amd64.deb) ...
 * Stopping Name Service Cache Daemon nscd [ OK ]
Unpacking replacement nscd ...
Processing triggers for ureadahead ...
Processing triggers for man-db ...
Setting up nscd (2.11.1-0ubuntu7.10) ...
 * Starting Name Service Cache Daemon nscd [ OK ]

For those affected, could it be that /etc/init.d/nscd is not executable for some reason?

Revision history for this message
biggie77 (noordwijk) wrote : RE: [Bug 652876] Re: package nscd 2.11.1-0ubuntu7.2 failed to install/upgrade: subprocess installed post-installation script returned error exit status 1 due to initscript failing to start
Download full text (4.4 KiB)

Thankes for the reply Etienne, the problem is not reproducable from my side either anymore, system works flawlessly again for roughly 6 months now!

Thanks again for your interest!

Kind regards,

Peter Warmerdam

> Date: Fri, 9 Mar 2012 18:20:58 +0000
> From: <email address hidden>
> To: <email address hidden>
> Subject: [Bug 652876] Re: package nscd 2.11.1-0ubuntu7.2 failed to install/upgrade: subprocess installed post-installation script returned error exit status 1 due to initscript failing to start
>
> I cannot reproduce this bug. In my case, when upgrading, the nscd
> service is first stopped (see nscd.prerm) before being started again (in
> nscd.postinst), so the upgrade works just fine.
>
> Witness:
>
> ubuntu@lucid-server:~$ dpkg -l nscd
> Desired=Unknown/Install/Remove/Purge/Hold
> | Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend
> |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
> ||/ Name Version Description
> +++-=================================-=================================-==================================================================================
> ii nscd 2.11.1-0ubuntu7 Embedded GNU C Library: Name Service Cache Daemon
> ubuntu@lucid-server:~$ sudo apt-get install nscd
> Reading package lists... Done
> Building dependency tree
> Reading state information... Done
> The following packages will be upgraded:
> nscd
> 1 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
> Need to get 0B/212kB of archives.
> After this operation, 4,096B of additional disk space will be used.
> (Reading database ... 42122 files and directories currently installed.)
> Preparing to replace nscd 2.11.1-0ubuntu7 (using .../nscd_2.11.1-0ubuntu7.10_amd64.deb) ...
> * Stopping Name Service Cache Daemon nscd [ OK ]
> Unpacking replacement nscd ...
> Processing triggers for ureadahead ...
> Processing triggers for man-db ...
> Setting up nscd (2.11.1-0ubuntu7.10) ...
> * Starting Name Service Cache Daemon nscd [ OK ]
>
>
> For those affected, could it be that /etc/init.d/nscd is not executable
> for some reason?
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/652876
>
> Title:
> package nscd 2.11.1-0ubuntu7.2 failed to install/upgrade: subprocess
> installed post-installation script returned error exit status 1 due to
> initscript failing to start
>
> Status in “eglibc” package in Ubuntu:
> Fix Released
> Status in “eglibc” source package in Lucid:
> Triaged
>
> Bug description:
> Problem occurred after apt-get install, apt-get remove and again apt-
> get install of the following packages:
>
> sudo apt-get install libpam-ldap libnss-ldap nss-updatedb libnss-db
> nfs-common nscd ldap-utils
>
> Description: Ubuntu 10.04.1 LTS
> Release: 10.04
>
> nscd:...

Read more...

Revision history for this message
Rolf Leggewie (r0lf) wrote :

lucid has seen the end of its life and is no longer receiving any updates. Marking the lucid task for this ticket as "Won't Fix".

Changed in eglibc (Ubuntu Lucid):
status: Triaged → Won't Fix
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.