[Pkg-shadow-devel] Whether we can put this lock files in the /var/run directory

Nicolas François nicolas.francois at centraliens.net
Tue May 3 22:52:20 UTC 2016


In the use case you describe, there is a risk that the system was put in
an inconsistent state (e.g. useradd could add the user in /etc/passwd, but
not yet in /etc/shadow).
The remaining lock files is a good indication for the system
administrators that the system has to be checked.

There were numerous reports on Ubuntu for what you describe. It led Ubuntu
to remove the lock files in an init script, but I'm not really fond of
it. I could not find out why there were such reports on Ubuntu, but not on
Debian (it could be due to a different system config, or to a larger user

Also, the execution time of useradd should be small, and the probability
to get a poweroff at the same time should be low (I expected lower than
the rate of the reports), so there might be a bias somewhere.

Finding this bias would be much more interesting: maybe the poweroff is
caused by the shadow execution? Maybe the execution/lock time is much
larger than I expect (e.g. tool has locked the file and request
information, ...)? Maybe one of the shadow utils forgets to remove one of
the lock file?, ...

In your case, did you experience this issue often? Did you have a poweroff
each time?

Best Regards,

On Mon, Apr 25, 2016 at 02:16:46PM +0800, liuxueping wrote:
> Hello:
>     When execute useradd or chage command,it will create some lock files in /etc directory,for example passwd.lock.If system reboot suddenly when execute useradd command,these lock files will been left behind /etc directory after the restart of the system,and it will faild if we execute useradd command and get the error "cannot lock /etc/passwd; try again later.".we need ro manually remove this lock files. Whether we can put this lock files in the /var/run directory?And this lock files are not in the system after the system reboot.
> _______________________________________________
> Pkg-shadow-devel mailing list
> Pkg-shadow-devel at lists.alioth.debian.org
> http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-shadow-devel

More information about the Pkg-shadow-devel mailing list