[CentOS] Change password and add user on RO filesystem

Tue Sep 4 11:26:00 UTC 2018
Marcin Trendota <moonwolf.rh at gmail.com>

Hi everyone

I'm trying to create system with RO root filesystem, so i'm using
/etc/sysconfig/readonly-root along wih /etc/rwtab and /etc/statetab.

Apart of numerous problems with services running on RO filesystem (which
i'm constantly resolving adding entries to /etc/statetab) one thing
popped up. I'm unable to add user or change his password. Error is
'cannot lock /etc/passwd; try again later.'.

After research it turns up (at least on Fedora, but i assume same on
CentOS) some files being created in /etc. For example /etc/shadow.<pid>,
and some others with PID in name. Obviously it's impossible on RO
filesystem...

Is there any workaround (apart of remounting whole filesystem RW)?

-- 
Over And Out
MoonWolf