useradd: cannot lock /etc/passwd; try again later.

Bug #523896 reported by Chris Howard
This bug affects 165 people
Affects Status Importance Assigned to Milestone
shadow (Ubuntu)
Fix Released
High
neilon johnson
Precise
Fix Released
High
neilon johnson
Quantal
Fix Released
High
neilon johnson

Bug Description

Binary package hint: postfix

Ubuntu 9.10, via Update Manager.

SOLUTION:

Look for /etc/group.lock, /etc/passwd.lock and /etc/shadow.lock files and remove them.

Be careful to only remove the files ending in 'lock' or else you might damage your system.

Please do not add comments just containing "Me too", instead please provide any information that could indicate why the files were locked:
 * the list of locked files:
    ls /etc/passwd.lock /etc/shadow.lock /etc/group.lock /etc/gshadow.lock

 * check the /var/log/auth.log for any message that could indicate the failure of any other tool (prior to the failure which reported the locked file)

 * any abnormal operation on the machine (reset, shutdown while the computer is still running)

== SRU template ==

[IMPACT]

 * Locked files prevent adding/removing/modifying system users & groups
 * This can result in failure to upgrade/remove packages that use system user names
 * The applied fix is to clear the locks on booting.

[TESTCASE]

 * $ sudo touch /etc/passwd.lock
 * $ sudo adduser testing523896
 * FAIL
 * Upgrade to new package
 * $ sudo adduser testing523896
 * FAIL
 * $ sudo reboot (or shutdown & poweron machine in any other way)
 * $ sudo adduser testing523896
 * PASS

 * Also you can touch the locks, check that they are there and run `$ sudo start passwd` to clear them.

[Regression Potential]

 * We are adding an extra job which will always run at boot, which will have a tiny impact on boot performance

 * The new job can be mis-used directly via `$ sudo start passwd`, but root user could clear the locks in the exact same way as well, before introducing this upstart job.

Revision history for this message
Chris Howard (guru42101) wrote :
Revision history for this message
Robert Campbell (bobert-campbell) wrote :

I didn't even want postfix installed, the auto update program decided it was a new dependancy of google-chrome. The update failed and google chrome was removed.

Revision history for this message
villi (villifesto) wrote :

Same issue as reported by Robert.

Revision history for this message
Chris Howard (guru42101) wrote :
Download full text (8.2 KiB)

This issue started for me originally with Jetty I think, I didn't have the ability to submit a bug report at the time. I began receiving an error about how it couldn't setup a Jetty user account. This is the data in /var/term.log for the latest update.

Log started: 2010-02-23 09:42:52
(Reading database ... 246453 files and directories currently installed.)
Preparing to replace libgssapi-krb5-2 1.7dfsg~beta3-1ubuntu0.3 (using .../libgssapi-krb5-2_1.7dfsg~beta3-1ubuntu0.4_i386.deb) ...
Unpacking replacement libgssapi-krb5-2 ...
Preparing to replace libkrb5-3 1.7dfsg~beta3-1ubuntu0.3 (using .../libkrb5-3_1.7dfsg~beta3-1ubuntu0.4_i386.deb) ...
Unpacking replacement libkrb5-3 ...
Preparing to replace libkrb5support0 1.7dfsg~beta3-1ubuntu0.3 (using .../libkrb5support0_1.7dfsg~beta3-1ubuntu0.4_i386.deb) ...
Unpacking replacement libkrb5support0 ...
Preparing to replace libk5crypto3 1.7dfsg~beta3-1ubuntu0.3 (using .../libk5crypto3_1.7dfsg~beta3-1ubuntu0.4_i386.deb) ...
Unpacking replacement libk5crypto3 ...
Preparing to replace linux-firmware 1.25 (using .../linux-firmware_1.26_all.deb) ...
Unpacking replacement linux-firmware ...
Setting up postfix (2.6.5-3) ...
Adding system user `postfix' (UID 114) ...
Adding new user `postfix' (UID 114) with group `postfix' ...
useradd: cannot lock /etc/passwd; try again later.
adduser: `/usr/sbin/useradd -d /var/spool/postfix -g postfix -s /bin/false -u 114 postfix' returned error code 1. Exiting.
dpkg: error processing postfix (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of bsd-mailx:
 bsd-mailx depends on postfix | mail-transport-agent; however:
  Package postfix is not configured yet.
  Package mail-transport-agent is not installed.
  Package postfix which provides mail-transport-agent is not configured yet. ...

Read more...

Revision history for this message
Chris Howard (guru42101) wrote :

Here is the output from today's Update.. I was originally going to post this yesterday, but copy/paste didn't grab it and I had closed the window. I *think* it has the same information as the previous post, just less verbose.

E: postfix: subprocess installed post-installation script returned error exit status 1
E: bsd-mailx: dependency problems - leaving unconfigured
E: mailx: dependency problems - leaving unconfigured
E: lsb-core: dependency problems - leaving unconfigured
E: lsb-graphics: dependency problems - leaving unconfigured
E: lsb-cxx: dependency problems - leaving unconfigured
E: lsb-desktop: dependency problems - leaving unconfigured
E: lsb: dependency problems - leaving unconfigured
E: google-chrome-beta: dependency problems - leaving unconfigured
E: jetty: subprocess installed post-installation script returned error exit status 1

Revision history for this message
Chris Howard (guru42101) wrote :

Seems to actually be a problem with chrome-beta and the prereqs it has.

Chuck Short (zulcss)
affects: postfix (Ubuntu) → ubuntu
Revision history for this message
Monkey (monkey-libre) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. This bug did not have a package associated with it, which is important for ensuring that it gets looked at by the proper developers. You can learn more about finding the right package at https://wiki.ubuntu.com/Bugs/FindRightPackage . I have classified this bug as a bug in postfix.
For future reference you might be interested to know that a lot of applications have bug reporting functionality built in to them. This can be accessed via the Report a Problem option in the Help menu for the application with which you are having an issue. You can learn more about this feature at https://wiki.ubuntu.com/ReportingBugs.

affects: ubuntu → postfix (Ubuntu)
Revision history for this message
Mathias Gug (mathiaz) wrote :

The root of the problem is:

useradd: cannot lock /etc/passwd; try again later.

Have you changed /etc/passwd? What are the permissions on the file?

This is not a bug in postfix.

Changed in postfix (Ubuntu):
status: New → Incomplete
importance: Undecided → Medium
summary: - package postfix 2.6.5-3 failed to install/upgrade: subprocess installed
- post-installation script returned error exit status 1
+ useradd: cannot lock /etc/passwd; try again later.
affects: postfix (Ubuntu) → shadow (Ubuntu)
Revision history for this message
Chris Howard (guru42101) wrote :

From what I could tell the passwd.lock and shadow.lock files had not been removed. I don't remember the permissions but they looked correct at the time. I can no longer reproduce the error as I have reloaded my machine for a separate reason.

Revision history for this message
Cecil (imcecil) wrote :

I'm having the same problem trying to install open ssh server off a fresh install although it is set up with nss to use ldap. The file permissions are the same as on the other computers, fuser displays no processes using the file and lslk also displays no locks. The groupadd and groupmod work but the other user admin tools such as userdel don't. I've tried reinstalling the passwd package and the only error I can find in the system is from libcrypt. This was from a alternate cd install of 9.10 maybe it's best just to reinstall?

Revision history for this message
danielz (danielzamorano) wrote :

the same problem after install some packages
all installation programs ends with error by:

userdel: cannot lock /etc/shadow; try again later.

Revision history for this message
Nicolas François (nekral-lists) wrote :

Just a note for any future bug reporter:

It is now clear that it happens that the passwd or shadow (or group, or gshadow) files can be locked.
The "me also messages" are not very useful (and will not make the resolution of this bug, if it is really a bug, any faster).

Please provide instead any information that could indicate why the files were locked:
 * the list of locked files:
    ls /etc/passwd.lock /etc/shadow.lock /etc/group.lock /etc/gshadow.lock

 * check the /var/log/auth.log for any message that could indicate the failure of any other tool (prior to the failure which reported the locked file)

 * any anormal operation on the machine (reset, shutdown while the computer is still running)

 * etc.

Revision history for this message
Mark - Syminet (mark-syminet) wrote :

I had the same situation here, it turns out it was a stuck useradd process -
destroying it got useradd working again, something like this:

killall -9 userdel
rm -f /etc/*lock

In my case the stuck useradd was caused by a bug in my own script, but
for the others, if it was caused by the package manager then I guess there
might be a package out there with a bug in it's call to useradd.

Revision history for this message
Raja Shekhar (rajashekhar-bala) wrote :

I had the same situation on my ubuntu 9.10 Karmic , I was trying to add my user id to dba Group in order to star
and stop the DB services by own ,
raja@ubuntu:~$ usermod -a -G dba raja
usermod: cannot lock /etc/passwd; try again later.
i checked for any process locked the /etc/passwd file but found nothing .
Then i tried to run the command with sudo
this time it worked.

description: updated
Revision history for this message
Thierry Carrez (ttx) wrote :

Might be a duplicate of bug 432964.

Changed in shadow (Ubuntu):
status: Incomplete → Confirmed
BackTrack (pmeyer)
tags: added: armel
Andreas Moog (ampelbein)
description: updated
Andreas Moog (ampelbein)
description: updated
Changed in shadow (Ubuntu):
assignee: nobody → Ubuntu Foundations Team (ubuntu-foundations-team)
Revision history for this message
dhrubo (dhrubo-1115) wrote : Re: [Bug 523896] Re: useradd: cannot lock /etc/passwd; try again later.

thnax for the solution............

Best Regards
Akil Afzal Dhrubo

Intern Technical Analyst
Standard Chartered Bank

Institute of Information Technology
University of Dhaka

________________________________
From: Brian Murray <email address hidden>
To: <email address hidden>
Sent: Thursday, July 28, 2011 2:08 AM
Subject: [Bug 523896] Re: useradd: cannot lock /etc/passwd; try again later.

** Changed in: shadow (Ubuntu)
     Assignee: (unassigned) => Ubuntu Foundations Team (ubuntu-foundations-team)

--
You received this bug notification because you are subscribed to a
duplicate bug report (684168).
https://bugs.launchpad.net/bugs/523896

Title:
  useradd: cannot lock /etc/passwd; try again later.

Status in “shadow” package in Ubuntu:
  Confirmed

Bug description:
  Binary package hint: postfix

  Ubuntu 9.10, via Update Manager.

  SOLUTION:

  Look for /etc/group.lock, /etc/passwd.lock and /etc/shadow.lock files
  and remove them.

  Be careful to only remove the files ending in 'lock' or else you might
  damage your system.

  Please do not add comments just containing "Me too", instead please provide any information that could indicate why the files were locked:
   * the list of locked files:
      ls /etc/passwd.lock /etc/shadow.lock /etc/group.lock /etc/gshadow.lock

   * check the /var/log/auth.log for any message that could indicate the
  failure of any other tool (prior to the failure which reported the
  locked file)

   * any anormal operation on the machine (reset, shutdown while the
  computer is still running)

  ProblemType: Package
  Architecture: i386
  Date: Thu Feb 18 09:49:47 2010
  DistroRelease: Ubuntu 9.10
  ErrorMessage: subprocess installed post-installation script returned error exit status 1
  InstallationMedia: Ubuntu 9.10 "Karmic Koala" - Release i386 (20091028.5)
  NonfreeKernelModules: fglrx
  Package: postfix 2.6.5-3
  ProcVersionSignature: Ubuntu 2.6.31-19.56-generic
  SourcePackage: postfix
  Title: package postfix 2.6.5-3 failed to install/upgrade: subprocess installed post-installation script returned error exit status 1
  Uname: Linux 2.6.31-19-generic i686

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/shadow/+bug/523896/+subscriptions

Steve Langasek (vorlon)
description: updated
Revision history for this message
Steve Langasek (vorlon) wrote :

It's been suggested that this might be a duplicate of bug 432964, which is described as "system crash in guest session locks /etc/passwd forever". Can the submitters of this bug and duplicates confirm whether they've used Ubuntu guest sessions on the affected system, and whether they saw crashes when doing so?

Nicolas, you comment in the other bug that we shouldn't clear locks on boot because they indicate something has gone wrong and shouldn't be ignored. While that's true, the trail on bugs like this is likely to be quite cold, and knowing the lock is there gives us only a slim chance of finding the cause. Since updates to these files are atomic and the lock files are used only to prevent two updates in parallel clobbering one another, there should be no file corruption and removing the locks should be safe - so I am inclined to say we should remove the locks at boot.

Revision history for this message
Nicolas François (nekral-lists) wrote :

I'm not really worried by the consistency of single files (each one are updated atomically).

The problem is the inconsistency between files (e.g. /etc/passwd and /etc/shadow).
I'm not sure what would be the worst case if for example /etc/passwd is updated but /etc/shadow is not.

Revision history for this message
Steve Langasek (vorlon) wrote :

On Sat, Aug 06, 2011 at 08:43:29AM -0000, Nicolas François wrote:
> I'm not really worried by the consistency of single files (each one are
> updated atomically).

> The problem is the inconsistency between files (e.g. /etc/passwd and
> /etc/shadow). I'm not sure what would be the worst case if for example
> /etc/passwd is updated but /etc/shadow is not.

I think the absolute worse case would be an account locked out because
/etc/passwd has been updated with an 'x' but the corresponding entry has not
been added to /etc/shadow. But a) that can be guarded against by changing
the files in the proper order (which is probably already being done), and b)
having lock files left behind doesn't help solve any of the resulting
problems.

Otherwise, I don't see any real possibility of breakage caused by having one
file updated without the other.

--
Steve Langasek Give me a lever long enough and a Free OS
Debian Developer to set it on, and I can move the world.
Ubuntu Developer http://www.debian.org/
<email address hidden> <email address hidden>

Changed in shadow (Ubuntu):
assignee: Ubuntu Foundations Team (ubuntu-foundations-team) → Canonical Foundations Team (canonical-foundations)
Revision history for this message
Steve Langasek (vorlon) wrote :

This has turned up on the radar again because whoopsie tries to call adduser on upgrade to 12.04, and many users are finding their /etc/passwd locked. We should update shadow to clear lock on boot.

Changed in shadow (Ubuntu Precise):
status: New → Triaged
importance: Undecided → High
Changed in shadow (Ubuntu Quantal):
status: Confirmed → Triaged
importance: Medium → High
Changed in shadow (Ubuntu Precise):
assignee: nobody → Canonical Foundations Team (canonical-foundations)
milestone: none → ubuntu-12.04.1
tags: added: rls-p-tracking
tags: added: bugpattern-written
Revision history for this message
typos1 (jhills1) wrote :

My upgrade to 12.04 has failed because of this.

I ve got an amd64 processor and using 64bit version, though.

What should I do get to get around it ?

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

typos1 - the bug description contains information about how to get around the bug.

tags: added: rls-q-incoming
Steve Langasek (vorlon)
tags: removed: rls-q-incoming
Revision history for this message
nick s (n123q45) wrote :

i dont have permission to remove the files

Revision history for this message
Fernando Giraldo (fercho) wrote :

verify that you are de root user command whoami else login with sudo su and
try the process for remove files

2012/7/11 nick s <email address hidden>

> i dont have permission to remove the files
>
> --
> You received this bug notification because you are subscribed to a
> duplicate bug report (988995).
> https://bugs.launchpad.net/bugs/523896
>
> Title:
> useradd: cannot lock /etc/passwd; try again later.
>
> Status in “shadow” package in Ubuntu:
> Triaged
> Status in “shadow” source package in Precise:
> Triaged
> Status in “shadow” source package in Quantal:
> Triaged
>
> Bug description:
> Binary package hint: postfix
>
> Ubuntu 9.10, via Update Manager.
>
> SOLUTION:
>
> Look for /etc/group.lock, /etc/passwd.lock and /etc/shadow.lock files
> and remove them.
>
> Be careful to only remove the files ending in 'lock' or else you might
> damage your system.
>
> Please do not add comments just containing "Me too", instead please
> provide any information that could indicate why the files were locked:
> * the list of locked files:
> ls /etc/passwd.lock /etc/shadow.lock /etc/group.lock
> /etc/gshadow.lock
>
> * check the /var/log/auth.log for any message that could indicate the
> failure of any other tool (prior to the failure which reported the
> locked file)
>
> * any abnormal operation on the machine (reset, shutdown while the
> computer is still running)
>
> ProblemType: Package
> Architecture: i386
> Date: Thu Feb 18 09:49:47 2010
> DistroRelease: Ubuntu 9.10
> ErrorMessage: subprocess installed post-installation script returned
> error exit status 1
> InstallationMedia: Ubuntu 9.10 "Karmic Koala" - Release i386 (20091028.5)
> NonfreeKernelModules: fglrx
> Package: postfix 2.6.5-3
> ProcVersionSignature: Ubuntu 2.6.31-19.56-generic
> SourcePackage: postfix
> Title: package postfix 2.6.5-3 failed to install/upgrade: subprocess
> installed post-installation script returned error exit status 1
> Uname: Linux 2.6.31-19-generic i686
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/ubuntu/+source/shadow/+bug/523896/+subscriptions
>

--

*GNU/LINUX #553303*

Se libre usa software libre!!

Changed in shadow (Ubuntu Precise):
milestone: ubuntu-12.04.1 → ubuntu-12.04.2
Revision history for this message
jhansonxi (jhansonxi) wrote :

Regarding #17 - I did just experience this problem but with /etc/group.lock instead of passwd. I did use a Guest session immediately before I discovered the breakage. The Guest account crashed when I attempted to play Open Arena, probably due to a fglrx bug. There was a leftover guest-???? group that I deleted.

Revision history for this message
Mark - Syminet (mark-syminet) wrote :
Download full text (3.4 KiB)

Just got bit by this one again, clean lucid install. The fix is to "rm -f /etc/gshadow.lock".

"sudo do-release-upgrade" finishes with this:

The upgrade has aborted. Your system could be in an unusable state. A
recovery will run now (dpkg --configure -a).

Setting up dbus (1.4.18-1ubuntu1) ...
groupadd: cannot lock /etc/gshadow; try again later.
adduser: `/usr/sbin/groupadd -g 112 messagebus' returned error code 10. Exiting.
dpkg: error processing dbus (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up whoopsie (0.1.32) ...
groupadd: cannot lock /etc/gshadow; try again later.
adduser: `/usr/sbin/groupadd -g 112 whoopsie' returned error code 10. Exiting.
dpkg: error processing whoopsie (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of language-selector-common:
 language-selector-common depends on dbus; however:
  Package dbus is not configured yet.
dpkg: error processing language-selector-common (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of ubuntu-standard:
 ubuntu-standard depends on language-selector-common; however:
  Package language-selector-common is not configured yet.
dpkg: error processing ubuntu-standard (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of accountsservice:
 accountsservice depends on dbus; however:
  Package dbus is not configured yet.
dpkg: error processing accountsservice (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 dbus
 whoopsie
 language-selector-common
 ubuntu-standard
 accountsservice

Upgrade complete

The upgrade has completed but there were errors during the upgrade
process.

To continue please press [ENTER]

--------------

...'x' to get out of it, then:

root@asdf:~# cd /etc
root@asdf:/etc# ls -l *lock
ls: unrecognized prefix: hl
ls: unparsable value for LS_COLORS environment variable
-rw------- 1 root root 0 Aug 14 16:41 gshadow.lock
root@asdf:/etc# lsof gshadow.lock
root@asdf:/etc# rm -f gshadow.lock
root@asdf:/etc# apt-get dist-upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
5 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]?
Setting up dbus (1.4.18-1ubuntu1) ...
dbus start/running, process 4465
Setting up accountsservice (0.6.15-2ubuntu9.3) ...
Setting up language-selector-common (0.79) ...
Installing new version of config file /etc/fonts/conf.avail/69-language-selector-zh-tw.conf ...
Installing new version of config file /etc/fonts/conf.avail/69-language-selector-ja-jp.conf ...
Installing new version of config file /etc/fonts/conf.avail/30-cjk-aliases.conf ...
Removing obsolete conffile /etc/fonts/conf.avail/69-language-selector-ko-kr.conf ...
Removing obsolete conffile /etc/fonts/conf.avail/29-language-selector-ko-kr.conf ...
Setting up whoopsie (0.1....

Read more...

Steve Langasek (vorlon)
Changed in shadow (Ubuntu Precise):
assignee: Canonical Foundations Team (canonical-foundations) → Dmitrijs Ledkovs (dmitrij.ledkov)
Steve Langasek (vorlon)
Changed in shadow (Ubuntu Quantal):
assignee: Canonical Foundations Team (canonical-foundations) → Dmitrijs Ledkovs (dmitrij.ledkov)
Changed in shadow (Ubuntu Quantal):
status: Triaged → In Progress
description: updated
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

Fix uploaded into quantal, waiting in unapproved queue.

Changed in shadow (Ubuntu Quantal):
status: In Progress → Fix Committed
assignee: Dmitrijs Ledkovs (xnox) → nobody
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

Fix uploaded into precise-proposed, waiting in unapproved queue.

Changed in shadow (Ubuntu Precise):
assignee: Dmitrijs Ledkovs (xnox) → nobody
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package shadow - 1:4.1.4.2+svn3283-3ubuntu7

---------------
shadow (1:4.1.4.2+svn3283-3ubuntu7) quantal; urgency=low

  * debian/passwd.upstart: Add an upstrat job to clear locks on
    [shadow-]passwd/group. (LP: #523896).
 -- Dmitrijs Ledkovs <email address hidden> Fri, 31 Aug 2012 13:00:33 +0100

Changed in shadow (Ubuntu Quantal):
status: Fix Committed → Fix Released
Revision history for this message
Clint Byrum (clint-fewbar) wrote : Please test proposed package

Hello Chris, or anyone else affected,

Accepted shadow into precise-proposed. The package will build now and be available at http://launchpad.net/ubuntu/+source/shadow/1:4.1.4.2+svn3283-3ubuntu5.1 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please change the bug tag from verification-needed to verification-done. If it does not, change the tag to verification-failed. In either case, details of your testing will help us make a better decision.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance!

Changed in shadow (Ubuntu Precise):
status: Triaged → Fix Committed
tags: added: verification-needed
Revision history for this message
Raoul Bhatia (raoul-bhatia) wrote :

FYI: There is a typo on the changelog:

> * debian/passwd.upstart: Add an upstrat job to clear locks on
> [shadow-]passwd/group. (LP: #523896).

"upstrat" vs. "upstart"

Cheers,
Raoul

Changed in shadow (Ubuntu Precise):
status: Fix Committed → Fix Released
Revision history for this message
Dimitri John Ledkov (xnox) wrote : Re: [Bug 523896] Re: useradd: cannot lock /etc/passwd; try again later.

On 23 September 2012 23:43, larrycornutt <email address hidden> wrote:
> ** Changed in: shadow (Ubuntu Precise)
> Status: Fix Committed => Fix Released
>

No, it was not. The package in precise-proposed and is still pending
verification. If it passes verification that the bug will be fix
released in precise, if verification will not be passed the package
with this fixed will be removed from precise-proposed.

Please help to verify this update as outlined in comment #30 above.
URL: https://bugs.launchpad.net/ubuntu/+source/shadow/+bug/523896/comments/30

Regards,

Dmitrijs.

Changed in shadow (Ubuntu Quantal):
status: Fix Released → Fix Committed
Revision history for this message
Mark - Syminet (mark-syminet) wrote :

I suspect this is related to the "mountall" binary package?
Which deserves to be condemned to all hell.

How DARE the packagers INFECT a distribution with a binary
upon startup, other than the kernel?

The only binary code upon turning on any computer,
should be the kernel.

Everything else is utterly disgusting.

Revision history for this message
Mark - Syminet (mark-syminet) wrote :
Download full text (3.2 KiB)

I could fix this myself if it wasn't for unbelievably
ridiculous shit like this:

On Ubuntu:

root@38r8:~# set |wc -l
6705

…on standard Debian:

4r6s1:~# set | wc -l
50
4r6s1:~#

…really? *Really*?

On Sep 23, 2012, at 4:50 PM, Dmitrijs Ledkovs wrote:

> On 23 September 2012 23:43, larrycornutt <email address hidden> wrote:
>> ** Changed in: shadow (Ubuntu Precise)
>> Status: Fix Committed => Fix Released
>>
>
> No, it was not. The package in precise-proposed and is still pending
> verification. If it passes verification that the bug will be fix
> released in precise, if verification will not be passed the package
> with this fixed will be removed from precise-proposed.
>
> Please help to verify this update as outlined in comment #30 above.
> URL: https://bugs.launchpad.net/ubuntu/+source/shadow/+bug/523896/comments/30
>
> Regards,
>
> Dmitrijs.
>
>
> ** Changed in: shadow (Ubuntu Quantal)
> Status: Fix Released => Fix Committed
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/523896
>
> Title:
> useradd: cannot lock /etc/passwd; try again later.
>
> Status in “shadow” package in Ubuntu:
> Fix Committed
> Status in “shadow” source package in Precise:
> Fix Released
> Status in “shadow” source package in Quantal:
> Fix Committed
>
> Bug description:
> Binary package hint: postfix
>
> Ubuntu 9.10, via Update Manager.
>
> SOLUTION:
>
> Look for /etc/group.lock, /etc/passwd.lock and /etc/shadow.lock files
> and remove them.
>
> Be careful to only remove the files ending in 'lock' or else you might
> damage your system.
>
> Please do not add comments just containing "Me too", instead please provide any information that could indicate why the files were locked:
> * the list of locked files:
> ls /etc/passwd.lock /etc/shadow.lock /etc/group.lock /etc/gshadow.lock
>
> * check the /var/log/auth.log for any message that could indicate the
> failure of any other tool (prior to the failure which reported the
> locked file)
>
> * any abnormal operation on the machine (reset, shutdown while the
> computer is still running)
>
> == SRU template ==
>
> [IMPACT]
>
> * Locked files prevent adding/removing/modifying system users & groups
> * This can result in failure to upgrade/remove packages that use system user names
> * The applied fix is to clear the locks on booting.
>
> [TESTCASE]
>
> * $ sudo touch /etc/passwd.lock
> * $ sudo adduser testing523896
> * FAIL
> * Upgrade to new package
> * $ sudo adduser testing523896
> * FAIL
> * $ sudo reboot (or shutdown & poweron machine in any other way)
> * $ sudo adduser testing523896
> * PASS
>
> * Also you can touch the locks, check that they are there and run `$
> sudo start passwd` to clear them.
>
> [Regression Potential]
>
> * We are adding an extra job which will always run at boot, which will have a tiny impact on boot performance
>
> * The new job can be mis-used directly via `$ sudo start passwd`, but root user could clear the locks in the exact same way as well, before introducing this upstart job.
>
> To manage...

Read more...

Changed in shadow (Ubuntu Precise):
status: Fix Released → Fix Committed
Changed in shadow (Ubuntu Quantal):
status: Fix Committed → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote :

I installed the versions of passwd and login from precise-proposed and followed the testcase and the locks (/etc/passwd.lock and /etc/group.lock) were removed.

tags: added: verification-done
removed: verification-needed
Revision history for this message
Colin Watson (cjwatson) wrote : Update Released

The verification of this Stable Release Update has completed successfully and the package has now been released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regresssions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package shadow - 1:4.1.4.2+svn3283-3ubuntu5.1

---------------
shadow (1:4.1.4.2+svn3283-3ubuntu5.1) precise-proposed; urgency=low

  * debian/passwd.upstart: Add an upstrat job to clear locks on
    [shadow-]passwd/group. (LP: #523896).
 -- Dmitrijs Ledkovs <email address hidden> Fri, 31 Aug 2012 13:00:33 +0100

Changed in shadow (Ubuntu Precise):
status: Fix Committed → Fix Released
Revision history for this message
Sam_ (and-sam) wrote :

There is a typo in changelog
.... * debian/passwd.upstart: Add an ++upstrat++ job ....

Changed in shadow (Ubuntu Precise):
assignee: nobody → neilon johnson (neilonjohnson33)
Changed in shadow (Ubuntu):
assignee: nobody → neilon johnson (neilonjohnson33)
Changed in shadow (Ubuntu Quantal):
assignee: nobody → neilon johnson (neilonjohnson33)
Revision history for this message
Udo Fassnacht (udo-fassnacht) wrote : Re: [Bug 523896] Re: useradd: cannot lock /etc/passwd; try again later.

Thank you very much for trying to help me, but it is too difficult for
me because I am just a user. After some updates ubuntu works very well
again.

Udo

Am 22.02.2013 17:08, schrieb neilon johnson:
> ** Changed in: shadow (Ubuntu Precise)
> Assignee: (unassigned) => neilon johnson (neilonjohnson33)
>
> ** Changed in: shadow (Ubuntu)
> Assignee: (unassigned) => neilon johnson (neilonjohnson33)
>
> ** Changed in: shadow (Ubuntu Quantal)
> Assignee: (unassigned) => neilon johnson (neilonjohnson33)
>

Revision history for this message
Horse Houlihan (frogwarrior) wrote :

I don't know what jetty is, and I never installed it, it must have came with a package. I first noticed the terminal mentioning it after I installed node.js so I'm guessing node.js installed it. Looking it up, I see its a web server. I use apache2 so I have no reason to have jetty installed, I've been getting error messages every time I install a new application now, so I'm gonna try removing jetty.

Revision history for this message
Horse Houlihan (frogwarrior) wrote :

Heres what happened when I tried to remove jetty:

horse@box:~$ sudo apt-get remove --purge jetty
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  jetty*
0 upgraded, 0 newly installed, 1 to remove and 3 not upgraded.
1 not fully installed or removed.
After this operation, 1,042 kB disk space will be freed.
Do you want to continue [Y/n]? y
(Reading database ... 341177 files and directories currently installed.)
Removing jetty ...
 * Stopping Jetty servlet engine (was reachable on http://box:8080/). jetty start-stop-daemon: user 'jetty' not found
start-stop-daemon: user 'jetty' not found
invoke-rc.d: initscript jetty, action "stop" failed.
dpkg: error processing jetty (--purge):
 subprocess installed pre-removal script returned error exit status 2
 * Not starting jetty - edit /etc/default/jetty and change NO_START to be 0 (or comment it out).
Errors were encountered while processing:
 jetty
E: Sub-process /usr/bin/dpkg returned an error code (1)

Revision history for this message
Barki Mustapha (mustbarki) wrote :

W: Failed to fetch http://ppa.launchpad.net/bzr/ppa/ubuntu/dists/wily/main/source/Sources 404 Not Found

W: Failed to fetch http://ppa.launchpad.net/bzr/ppa/ubuntu/dists/wily/main/binary-amd64/Packages 404 Not Found

W: Failed to fetch http://ppa.launchpad.net/bzr/ppa/ubuntu/dists/wily/main/binary-i386/Packages 404 Not Found

E: Some index files failed to download. They have been ignored, or old ones used instead.

Revision history for this message
Barki Mustapha (mustbarki) wrote :
Download full text (16.6 KiB)

barki@ninja-network:~$ sudo apt-get update
sudo: unable to resolve host ninja-network
[sudo] password for barki:
Ign http://dl.google.com stable InRelease
Ign http://ppa.launchpad.net wily InRelease
Hit http://dl.google.com stable Release.gpg
Ign http://archive.canonical.com trusty InRelease
Hit http://archive.ubuntu.com wily InRelease
Get:1 http://ppa.launchpad.net wily InRelease [15.4 kB]
Hit http://dl.google.com stable Release
Hit http://archive.canonical.com trusty Release.gpg
Get:2 http://archive.ubuntu.com wily-updates InRelease [64.4 kB]
Hit http://ppa.launchpad.net wily InRelease
Hit http://archive.canonical.com trusty Release
Hit http://ppa.launchpad.net wily InRelease
Ign http://ppa.launchpad.net wily Release.gpg
Get:3 http://ppa.launchpad.net wily/main Sources [582 B]
Get:4 http://ppa.launchpad.net wily/main amd64 Packages [839 B]
Get:5 http://ppa.launchpad.net wily/main i386 Packages [839 B]
Hit http://dl.google.com stable/main amd64 Packages
Hit http://archive.ubuntu.com wily-backports InRelease
Get:6 http://ppa.launchpad.net wily/main Translation-en [396 B]
Hit http://dl.google.com stable/main i386 Packages
Get:7 http://archive.ubuntu.com wily-security InRelease [64.4 kB]
Hit http://archive.canonical.com trusty/partner Sources
Get:8 http://ppa.launchpad.net wily/main Translation-en [133 B]
Get:9 http://archive.ubuntu.com wily-proposed InRelease [218 kB]
Hit http://archive.canonical.com trusty/partner amd64 Packages
Hit http://archive.canonical.com trusty/partner i386 Packages
Ign http://dl.google.com stable/main Translation-en_US
Ign http://dl.google.com stable/main Translation-en
Ign http://archive.canonical.com trusty/partner Translation-en
Ign http://ppa.launchpad.net wily Release
Hit http://ppa.launchpad.net wily/main Sources
Hit http://ppa.launchpad.net wily/main amd64 Packages
Hit http://ppa.launchpad.net wily/main i386 Packages
Hit http://ppa.launchpad.net wily/main Sources
Hit http://ppa.launchpad.net wily/main amd64 Packages
Hit http://ppa.launchpad.net wily/main i386 Packages
Hit http://ppa.launchpad.net wily/main Translation-en
Ign http://ppa.launchpad.net wily/main Translation-en
Get:10 http://archive.ubuntu.com wily-updates/main Sources [41.4 kB]
Ign ...

Revision history for this message
Seth Arnold (seth-arnold) wrote :

Barki, sudo rm -f /etc/gshadow.lock ; sudo apt-get install -f

Thanks

Revision history for this message
Barki Mustapha (mustbarki) wrote :

up to date 16.04

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

Related questions

Remote bug watches

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