[Bug 523896] Re: useradd: cannot lock /etc/passwd; try again later.
Horse Houlihan
frogwarrior at gmx.com
Mon Feb 3 16:19:48 UTC 2014
Heres what happened when I tried to remove jetty:
horse at 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)
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to shadow in Ubuntu.
https://bugs.launchpad.net/bugs/523896
Title:
useradd: cannot lock /etc/passwd; try again later.
Status in “shadow” package in Ubuntu:
Fix Released
Status in “shadow” source package in Precise:
Fix Released
Status in “shadow” source package in Quantal:
Fix Released
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 notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/shadow/+bug/523896/+subscriptions
More information about the foundations-bugs
mailing list