0

I maintain a package that is built for debian, RedHat, and SUSE Linux distributions. Part of the post install script follows:

/usr/sbin/useradd -r -d /var/opt/CampbellSci/LoggerNet loggernet

This command appears to work in other distributions but, under SUSE, the "loggernet" group is not being created and the home directory was created under the "root" group. According to the man page for useradd, the group is supposed to be automatically created unless the -g -N, or -U option is used. Is there any reason why SUSE is failing to create the appropriate group?

1 Answer 1

1

The manual page says something different. Quoting from OpenSUSE 13:

By default, a group will also be created for the new user (see -g, -N, -U, and USERGROUPS_ENAB).

and

-g, --gid GROUP
The group name or number of the user's initial login group. The group name must exist. A group number must refer to an already existing group.

If not specified, the behavior of useradd will depend on the USERGROUPS_ENAB variable in /etc/login.defs. If this variable is set to yes (or -U/--user-group is specified on the command line), a group will be created for the user, with the same name as her loginname. If the variable is set to no (or -N/--no-user-group is specified on the command line), useradd will set the primary group of the new user to the value specified by the GROUP variable in /etc/default/useradd, or 100 by default.

In my OpenSUSE 13 VM, the setting in /etc/login.defs is (the default) no.

In OpenSUSE 12, this feature did not exist.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .