From owner-freebsd-arm@freebsd.org Wed Jul 20 20:55:25 2016 Return-Path: Delivered-To: freebsd-arm@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0889FB9F1BF for ; Wed, 20 Jul 2016 20:55:25 +0000 (UTC) (envelope-from russ.haley@gmail.com) Received: from mail-vk0-x236.google.com (mail-vk0-x236.google.com [IPv6:2607:f8b0:400c:c05::236]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id ACB4C1D01; Wed, 20 Jul 2016 20:55:24 +0000 (UTC) (envelope-from russ.haley@gmail.com) Received: by mail-vk0-x236.google.com with SMTP id n129so40790175vke.3; Wed, 20 Jul 2016 13:55:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=7di5OowLS672NAOSVKuAxpgithsZWzEKUvqZiL0DxR4=; b=l5eLS5crU4QHwLOJYoF7AeN3ibtDnVr1ThTG7MHFeTGIiM+sPw7iUP8685mn1w7Icw BvVO7CeBDrKaz3os/SESew3zxXWkxHmHIsSd+HqFyapWx3xHcG+UrkT0bhHBFppG5YVh 21cVrv1aMCNL4HPWeLJ/Gkmg9/qtNMnJrUA1xTpQXku4smtKLG0WJFXyRzqq28pLQXCV gtLOlTSnqFbSFplOoGBKLVW5U28nhs+gJQoTg5dWiG3b8K4zYuFv6TTaBH+1GJhUVl4M l4VBEgrSxc6Tr8sJDr6qY5MctQLKu6+Fe2IeqCLgEpqJmz003TwckGLlX+y4IaHbwrJE 4yew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=7di5OowLS672NAOSVKuAxpgithsZWzEKUvqZiL0DxR4=; b=MCxwKIE8tlxhVoU58yQk/q74qEfez7sdyHNJQHiDDiff0s+TyzHS+b3Wmn7SjmAx46 MfMHG0JUEsW36ghAwjR9EUJm3CPzecjl0r089rG70zg5aXMElK2ytbzgseCzU69HBm5b xiUFREoPyZAqjnwg5WYP+JnjxCaMLC5HXN8xJ8W3pZjeYQHu+riQTGLSxFvAnYzps+s5 geOU3QI5/KhrVYTNp/BFS+0YILCYvvE+Ksx/9l38JMa2cJkER4TRZ8HmGjgupE6fcmkC 0jlJ4LH0IYiCUp1i2IEsypCyqHWqG49c/CIzuNb8qVQV0EnvYV1/TENwg0LRBZwV0+9y wc8w== X-Gm-Message-State: ALyK8tIIzhPLJeAH3Lqk07iy/6az3M0oO4OgRj+7cjit83h1iECi3oAr0/3lKFYA8mcXX+jxmTiw8nkDgxvbMQ== X-Received: by 10.159.35.143 with SMTP id 15mr25902763uao.39.1469048123393; Wed, 20 Jul 2016 13:55:23 -0700 (PDT) MIME-Version: 1.0 Received: by 10.31.54.75 with HTTP; Wed, 20 Jul 2016 13:55:23 -0700 (PDT) In-Reply-To: <20160720195652.GE65494@FreeBSD.org> References: <20160720195652.GE65494@FreeBSD.org> From: Russell Haley Date: Wed, 20 Jul 2016 14:55:23 -0600 Message-ID: Subject: Re: FreeBSD user home directory To: Glen Barber Cc: freebsd-arm Content-Type: text/plain; charset=UTF-8 X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jul 2016 20:55:25 -0000 On Wed, Jul 20, 2016 at 1:56 PM, Glen Barber wrote: > On Wed, Jul 20, 2016 at 01:45:47PM -0600, Russell Haley wrote: >> Hi guys, >> >> Note: auto-correct on this computer is setting freebsd to FreeBSD. >> Please assume lowercase where appropriate if I don't catch them all. >> >> I've decided to be lazy and just use the default freebsd user with the >> stuff I'm doing right now. I have two separate instances running: >> 10.2 in a Digital Ocean instance and arm 11-ALPHA-6 on my >> Hummingboard. >> >> The home directory for the FreeBSD user on the 10.2 cloud instance is >> in the expected location of /usr/home/freebsd. >> >> freebsd@do:~ % pwd >> /usr/home/freebsd >> >> However, the arm build puts the freebsd home directory is under /home/freebsd >> >> freebsd@imx6:~ % pwd >> /home/freebsd >> >> Thanks to a previous conversation with Mikael I have found that the >> script /usr/src/release/tools/arm.subr calls function >> arm_create_user() which places the user under /home (like debian). >> Can someone indicate if this is a mistake (which I think it is) or on >> purpose. >> From http://svnweb.freebsd.org/base/stable/11/release/tools/arm.subr?view=markup: >> > > No, this was not a mistake. This is from the pw(8) manual: > > -d dir This option sets the account's home directory. Normally, > this is only used if the home directory is to be different > from the default determined from /etc/pw.conf - normally > /home with the account name as a subdirectory. > > It's a matter of preference. Some installs will create /home as > a symlink to /usr/home, some with /usr/home as a symlink to /home. > >> 79 arm_create_user() { >> 80 # Create a default user account 'freebsd' with the password 'freebsd', >> 81 # and set the default password for the 'root' user to 'root'. >> 82 chroot ${CHROOTDIR} /usr/sbin/pw -R ${DESTDIR} \ >> 83 groupadd freebsd -g 1001 >> 84 chroot ${CHROOTDIR} mkdir -p ${DESTDIR}/home/freebsd >> 85 chroot ${CHROOTDIR} /usr/sbin/pw -R ${DESTDIR} \ >> 86 useradd freebsd \ >> 87 -m -M 0755 -w yes -n freebsd -u 1001 -g 1001 -G 0 \ >> 88 -c 'FreeBSD User' -d '/home/freebsd' -s '/bin/csh' >> 89 chroot ${CHROOTDIR} /usr/sbin/pw -R ${DESTDIR} \ >> 90 usermod root -w yes >> 91 >> 92 return 0 >> 93} >> >> Incidentally, I tried to look up the "correct location" by using man >> hier and neither instance indicates that a home folder even exists! I >> also believe this to be an oversight. Again, if it is, please let me >> know and I will attempt to create the correct problem report and >> hopefully at some point some patches (i'm not in my usual environment >> so doing stuff with src isn't convenient right now). >> > > With the manual page quote above, I don't think there is any "wrong" > behavior here. > > On your DigitalOcean machine, does /home exist? If so, I suspect it is > a symlink. Thanks for the awesome fast response Glen. Yes, you are correct there is a symlink to /home in the DO instance. However in the arm instance there are no symlinks in either direction: freebsd@imx6:/% ll total 81 -rw-r--r-- 2 root wheel 1481 Jul 1 16:06 .cshrc -rw-r--r-- 2 root wheel 750 Jul 1 16:06 .profile drwxrwxr-x 2 root operator 512 Jul 1 15:42 .snap/ -r--r--r-- 1 root wheel 6190 Jul 1 15:44 COPYRIGHT drwxr-xr-x 2 root wheel 1024 Jul 1 15:43 bin/ drwxr-xr-x 9 root wheel 1024 Jul 1 17:25 boot/ dr-xr-xr-x 17 root wheel 512 Jul 1 17:25 dev/ -rw-r--r-- 1 root wheel 4096 Jul 1 17:25 entropy drwxr-xr-x 25 root wheel 2560 Jul 2 11:52 etc/ drwxr-xr-x 4 root wheel 512 Jul 2 11:52 home/ drwxr-xr-x 4 root wheel 1536 Jul 1 15:43 lib/ drwxr-xr-x 3 root wheel 512 Jul 1 15:42 libexec/ drwxr-xr-x 2 root wheel 512 Jul 1 15:42 media/ drwxr-xr-x 2 root wheel 512 Jul 1 15:42 mnt/ dr-xr-xr-x 2 root wheel 512 Jul 1 15:42 proc/ drwxr-xr-x 2 root wheel 2560 Jul 1 15:43 rescue/ drwxr-xr-x 6 root wheel 512 Jul 2 00:02 root/ drwxr-xr-x 2 root wheel 2560 Jul 1 15:44 sbin/ lrwxr-xr-x 1 root wheel 11 Jul 1 15:42 sys@ -> usr/src/sys drwxrwxrwt 7 root wheel 180 Jul 2 09:35 tmp/ drwxr-xr-x 15 root wheel 512 Jul 2 11:52 usr/ drwxr-xr-x 24 root wheel 512 Jul 1 17:25 var/ freebsd@imx6:/usr% ll total 76 drwxr-xr-x 2 root wheel 8192 Jul 1 15:44 bin/ drwxr-xr-x 2 root wheel 512 Jul 2 11:52 home/ drwxr-xr-x 54 root wheel 6656 Jul 1 15:43 include/ drwxr-xr-x 10 root wheel 15360 Jul 1 15:44 lib/ drwxr-xr-x 4 root wheel 512 Jul 1 15:42 lib32/ drwxr-xr-x 6 root wheel 512 Jul 1 15:42 libdata/ drwxr-xr-x 8 root wheel 1536 Jul 1 15:44 libexec/ drwxr-xr-x 14 root wheel 512 Jul 2 00:02 local/ drwxr-xr-x 2 root wheel 512 Jul 1 15:42 obj/ drwxr-xr-x 2 root wheel 5120 Jul 1 15:44 sbin/ drwxr-xr-x 33 root wheel 1024 Jul 1 15:42 share/ drwxr-xr-x 2 root wheel 512 Jul 1 15:42 src/ drwxr-xr-x 15 root wheel 512 Jul 1 15:44 tests/ Which seems to me to still be in error as there are now TWO home directories. Maybe I haven't been paying enough attention when generating users but I could have sworn that all previous users I create went under /usr/home (I know, I'm being pedantic if the symlink exists). Thanks Russ