defaultのrc.confとホームディレクトリの作成

 NANNOはNANNOだった。RLoginの作者が昔の顔知りだった事にびっくり。

 

 それはそうと、

 '/etc/rc.conf' 以外に '/etc/defaults/rc.conf' というのがある。

 第6回 サービス管理の要/etc/rc.confと/etc/rc.conf.d/,単一ファイルと分割ファイル:BSD界隈四方山話|gihyo.jp … 技術評論社

が参考になる。

 ブート時、最初に '/etc/defaults/rc.conf' が読み込まれ、次に '/etc/rc.conf' が読み込まれる。同じ変数に対する値の書き込みがあった場合、'/etc/rc.conf' の値が上書きされるので、動作としては '/etc/rc.conf' が優先される。

 '/etc/rc.conf' が存在しなければ、'/etc/defaults/rc.conf'のみが読み込まれ実行される事になる。

 '/etc/defaults/rc.conf'を書き換えてはならない。修正が必要なら、'/etc/rc.conf'に記述して'/etc/defaults/rc.conf'の内容を上書きする。

 

 muhでログイン時、'Could not chdir to home directory /home/muh: No such file or directory' と文句を云われたので作っておこうと思ったが、これはこれで手順を残しておかないと、後で混乱しそう。

root@FreeBSD-11:/ # ls -l /home
lrwxr-xr-x 1 root wheel 8 Mar 16 07:48 /home -> usr/home

root@FreeBSD-11:/ # ls -l /home/usr
ls: /home/usr: No such file or directory

  つまり、'/home' は 'usr/home' へのシンボリックリンク。'/home' は存在しているが、'/home/usr' はまだ存在していないから、作ってやらなくてはならない。

root@FreeBSD-11:/ # cd usr
root@FreeBSD-11:/usr # mkdir home
root@FreeBSD-11:/usr # cd home
root@FreeBSD-11:/usr/home # mkdir muh

  rebootした後、再度muhでログインした後のログインメッセージが以下の通り。

Last login: Sat Mar 17 21:22:11 2018 from 10.0.2.2
FreeBSD 11.1-RELEASE-p8 (GENERIC) #0: Tue Mar 13 16:59:07 UTC 2018

Welcome to FreeBSD!

Release Notes, Errata: https://www.FreeBSD.org/releases/
Security Advisories: https://www.FreeBSD.org/security/
FreeBSD Handbook: https://www.FreeBSD.org/handbook/
FreeBSD FAQ: https://www.FreeBSD.org/faq/
Questions List: https://lists.FreeBSD.org/mailman/listinfo/freebsd-questions/
FreeBSD Forums: https://forums.FreeBSD.org/

Documents installed with the system are in the /usr/local/share/doc/freebsd/
directory, or can be installed later with: pkg install en-freebsd-doc
For other languages, replace "en" with a language code like de or fr.

Show the version of FreeBSD installed: freebsd-version ; uname -a
Please include that output and any error messages when posting questions.
Introduction to manual pages: man man
FreeBSD directory layout: man hier

Edit /etc/motd to change this login announcement.

  特に怒られている気配はない。