I faced with small difference in behavior of userdel utility on Ubuntu 10.04 and 14.04 and now struggling trying to fix it. I have kind of "hardening" script which should remove user via userdel utility. It's a little bit ugly since it have to remove user which actually run this script. But changing this would be last option since it will lead to tons of managers flying around and arguing why behavior was changed...
So i use following command to remove user inside my script:
userdel -r -f administrator
On Ubuntu 10.04 it works perfectly and remove administrator user completely.
But on ubuntu 14.04 results looks slightly different:
userdel: user administrator is currently used by process ${PID of running hardening script}
userdel: cannot open /etc/subuid
Obviously I can't kill process since doing so I will kill my hardening script itself. So is there any way to remove user (let say by itself) at Ubuntu 14.04 ?