>>>>> "Marc" == Marc Haber <[EMAIL PROTECTED]> writes:
Marc> On Thu, 27 Oct 2005 08:54:18 +1000, Brian May Marc> <[EMAIL PROTECTED]> wrote: >> If the code "just" calls adduser, this would seem to be a bug, >> as adduser will exit with a warning if the user already exists >> (see #264570). (If I am mistaken here with the precise details >> it is because the man page has mislead me). Marc> You are mistaken. adduser will print a warning that the user Marc> already exists and then exit with a zero exit code, if the Marc> already existing account conforms to the account attributes Marc> requested in the adduser call. That is my point - adduser will print a warning if the user already exists. So you need to check to make sure the user doesn't exist first, before attempting to add it. Or you get a stupid warning appearing when upgrading packages. >> So either you have to redirect stderr to /dev/null (this could >> mask serious errors too), or just to make sure the user doesn't >> exist first (preferred IMHO). Marc> You can also use adduser --quiet and get rid of the Marc> warnings. Not according to the man page[1]: --quiet Suppress progress messages. or in a practical sense either: [EMAIL PROTECTED]:~# adduser aaa adduser: The user `aaa' already exists. [EMAIL PROTECTED]:~# adduser --quiet aaa adduser: The user `aaa' already exists. (this is sarge/stable - maybe it has changed in unstable?) >> However, this has to be done carefully, or you end up doing the >> wrong thing. e.g. deluser -r $USER, in the past, has been pure >> evil if the home directory has been changed to "/"! Marc> Deluser has a configuratble regexp and refuses to delete Marc> files matching that regexp. Good. Note: [1] What is a "progress" message? -- Brian May <[EMAIL PROTECTED]> -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]