Bug #4460

adduser should be used to add user on Ubuntu/Debian instead of useradd

Added by Mathias Gug over 1 year ago. Updated over 1 year ago.

Status:Needs More Information Start date:08/03/2010
Priority:Normal Due date:
Assignee:Mathias Gug % Done:

0%

Category:user
Target version:-
Affected Puppet version: Branch:
Keywords:
Votes: 0

Description

If a user is created via puppet useradd is called. The recommendation on Ubuntu and Debian is to use adduser instead.

See https://bugs.launchpad.net/ubuntu/+source/puppet/+bug/64700.

History

Updated by James Turnbull over 1 year ago

  • Category set to user
  • Status changed from Unreviewed to Needs More Information
  • Assignee set to Mathias Gug

Mattias – any chance of some code from Canonical for this?

Updated by Joe McDonagh over 1 year ago

I am against this. I’d like to see this discussed more in-depth, especially why such a change is necessary when the man page specifically states adduser is a frontend to useradd. If puppet is already using the low-level tool, without significant issue on debian and derivatives, why add another layer of complexity?

Updated by Nigel Kersten over 1 year ago

I’d really like to see some justification as to why this change should be made too.

I’m not necessarily against it, I just don’t see a reason here…

Updated by Markus Roberts over 1 year ago

After reading the thread linked in the report, I am inclined to reject this ticket. The “bug” is essentially that if you add a user with puppet and don’t specify a shell you get the system default shell (sh), which the debian maintainers have changed from bash to dash.

Saying that puppet should use a higher level tool which has its own defaulting mechanism (and thus wasn’t affected by the change) to “fix” this seems silly.

If you do not want the system default shell you should 1) specify the shell, or 2) change the user default, both of which are easy to do with puppet. If you fell that debian should go back to having bash as the default you should talk to them.

Updated by James Turnbull over 1 year ago

+1 on Markus and Nigel’s comments.

Updated by Mathias Gug over 1 year ago

As mentioned in the useradd man page:

useradd is a low level utility for adding users. On Debian, administrators should usually use adduser(8) instead.

puppet being a higher level tool to manage system it seems that it should use tools that are the recommended way of doing things in a specific in environment. In the Debian and Ubuntu world adduser is the recommended way of adding a user to the system.

It’s true that useradd is called by adduser and is a lower level tool. Why should puppet use useradd then? Puppet could also edit /etc/passwd and create home directories instead of calling useradd. It all depends at which level of abstraction puppet should be inserted.

Also available in: Atom PDF