[oi-dev] Ideas about fixing useradd -m

Jim Klimov jimklimov at cos.ru
Thu Jul 28 10:03:34 UTC 2016


28 июля 2016 г. 11:25:17 CEST, Andrew Gabriel <illumos at cucumber.demon.co.uk> пишет:
>On 28/07/2016 09:17, Udo Grabowski (IMK) wrote:
>> On 28/07/2016 09:04, Alexander Pyhalov wrote:
>>> Hi.
>>>
>>> There is an old issue (https://www.illumos.org/issues/263):
>>> useradd -m tries to create home directory under /home, but /home is 
>>> auto-mounted
>>> from /export/home.
>>>
>>> For useradd -m to work, you should specify useradd -m -b
>/export/home 
>>> ..., but
>>> users created in such way are not equivalent to initial user, which 
>>> we get on
>>> install, as for them mapping in /etc/auto_home is not created.
>>>
>>> OI /dev had several patches to fix this:
>>>
>>>
>https://github.com/illumos/illumos-gate/commit/d6271a348bada25d0a512551be0ae6a9aa334d84
>
>>>
>>> (263 useradd is unable to create home directory)
>>>
>>> and
>>>
>https://github.com/illumos/illumos-gate/commit/70501a0c9a45806dbe4a81c2195b2647fa982f79
>
>>>
>>>
>>> ( 288 New homedirs should have auto_home entries)
>>>
>>> I think that these patches are too specific to be accepted in 
>>> illumos-gate.
>>> What can we do with it? Perhaps we just remove all auto_home magic
>by 
>>> default
>>> and create home directories under /export/home ?
>>>
>>> We also could set something like
>>> *    localhost:/export/home/&
>>> in /etc/auto_home, but IIRC this leads to the following : if you try
>
>>> to access
>>> /home/bar you'll receive irritating error messages on console about 
>>> missing
>>> /export/home/bar.
>>>
>>>
>>
>> As you said, it's too specific. Users using NFS mounted directories
>> for /home have wildly different setups (we alone had three completely
>> different approaches in a decade), they know what they do. So the
>> best option is to leave it as it is, either the admin uses the -b
>> option, or don't  use the -m option at all since he creates that
>> directory by different measures.
>
>Agree.
>It's the wrong fix for the problem of useradd not working out of the
>box.
>
>A better (and much simpler) fix would be for useradd to use
>/export/home 
>as the default for homedirs, which would make useradd on a new 
>stand-alone install just work.
>
>If you want useradd to work with maps, it's going to need a ton more 
>smarts which aren't in it at the moment, and I bet people with 
>widespread use of maps still wouldn't use it, so I think there's little
>
>point in that effort.

And at that - should (does?) the default useradd take advantage of zfs when creating homes (dataset per user)? Can it be told to use a specific dataset for the user populace in ge eral and/or in particular invokations (e.g. tank/export vs rpool/export)? That's the useful stuff ;)

Jim
--
Typos courtesy of K-9 Mail on my Samsung Android




More information about the oi-dev mailing list