On Mon, Jun 27, 2022 at 11:20:45AM -0400, Matt Barry wrote:
> The simplest way I can think of to solve this is:
> 
> (start)
>       mkdir /tmp/adduser.lock
>       sleep and loop until mkdir succeeds
> 
> (end)
>       remove /tmp/adduser.lock
> 
> which should be atomic assuming a local /tmp.
> 
> One could possibly add a /tmp/adduser.lock/adduser.pid and check for a
> dead lock.. I hesitate to overcomplicate this one (and certainly don't
> want a dependency for it).

/run/adduser please, and probably a simple flock()? lock files in a
shell script are a minefield for code running as root, I hope it is
easier in perl.

Greetings
Marc

-- 
-----------------------------------------------------------------------------
Marc Haber         | "I don't trust Computers. They | Mailadresse im Header
Leimen, Germany    |  lose things."    Winona Ryder | Fon: *49 6224 1600402
Nordisch by Nature |  How to make an American Quilt | Fax: *49 6224 1600421

Reply via email to