Red Hat Bugzilla – Bug 295511
userdel man page inconsistency
Last modified: 2007-11-30 17:12:16 EST
The description of the -f/--force option in the userdel man page says "This
option forces the removal of the user, even if she is still logged in."
Under CAVEATS, it says "userdel will not allow you to remove an account if the
user is currently logged in. You must kill any running processes which belong to
an account that you are deleting."
The actual behavior of the userdel program is consistent with the CAVEATS note;
-f does not allow removing a user account if the user is logged in.
Actually, userdel -f does indeed delete the user, but it still complains "user
blat is currently logged in". The return code is 0 instead of 8, however.
Pretty confusing behavior.
I don't really see it as confusing as the return code is what is relevant for
testing the regular unix commands success/failure.