Bug #263


useradd is unable to create home directory

Added by Roy Sigurd Karlsbakk almost 12 years ago. Updated over 11 years ago.

OS/Net (Kernel and Userland)
Target version:
Start date:
Due date:
% Done:


Estimated time:


When trying to create a new user (here for icinga, a nagios fork), with useradd -m, this fails to create the homedir. The user is created, however, but homedir creation and so on must be done manually.

root@openindiana:/usr/src/icinga-1.0.3# useradd -m icinga
UX: useradd: ERROR: Unable to create the home directory: Operation not applicable.

root@openindiana:/usr/src/icinga-1.0.3# grep icinga /etc/passwd 

Related issues

Blocks OpenIndiana Distribution - Feature #288: New homedirs should have auto_home entriesResolvedAlbert Lee2010-10-01

Blocks OpenIndiana Distribution - Bug #293: useradd/del/mod should be ZFS-awareResolvedAlbert Lee2010-10-03

Actions #1

Updated by Roy Sigurd Karlsbakk almost 12 years ago

Seems this issue is related to auto_home somehow. When OI is installed, the initial user is created with home directory /export/home/username and added to /etc/auto_home. Adding a user with useradd -m will automatically try to create /home/username, which isn't allowed, since /home is just a mount point for auto_home. Manually creating /export/home/username, chmod'ing the dir and changing /etc/auto_home to * localhost:/export/home/& instead of username localhost:/export/home/& fixes this, but useradd -m really should work nevertheless.


Actions #2

Updated by Jeppe Toustrup almost 12 years ago

This should perhaps be changed to set the default home directory for new users to be /export/home/<username> instead of /home/<username> and also the change you mention to /etc/auto_home.

A workaround would be to run "useradd -D -b /export/home" before creating the user, that will make the default home directory for the user /export/home/<username>, and then don't hit into the auto_home stuff.

Actions #3

Updated by Albert Lee over 11 years ago

A nicer fix would be to teach useradd about autofs, although the extent to which you can actually do this is limited by access to automountd's internal state. A hack could be to prepend "/export" to a path if the filesystem is determined to be autofs.

Actions #4

Updated by Albert Lee over 11 years ago

  • Assignee set to Albert Lee
  • Target version set to oi_148

Working on it.

Actions #5

Updated by Albert Lee over 11 years ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 50

Patch guaranteed to make your eyes bleed, but it's merely in keeping with the spirit of the program:

With these changes, home directory creation on autofs will still fail at the chown step if there isn't an

*    localhost:/export/home/&
map or username specific map in auto_home.

This might be a duplicate of: indicates that SMC was doing something similar.

See also the discussion for:

Actions #6

Updated by Albert Lee over 11 years ago

  • Status changed from In Progress to Resolved

Fixed in oi_148 along with its related bugs.


Also available in: Atom PDF