FreeBSD13の初期設定
FreeBSD 13.0-RELEASEをインストールしてみる。 本記述は13.0-BEATA3時点での内容であるが、13.0がリリースされた後、微調整する。
目次
- FreeBSD13の初期設定
-
初期設定
- /boot/loader.conf
- /etc/cron.d/portsupdate
- /etc/newsyslog.conf
- /etc/newsyslog.conf.d/ntpd.conf
- /etc/newsyslog.conf.d/ports-svn-update.conf
- /etc/newsyslog.conf.d/sudo.conf
- /etc/periodic.conf
- /etc/ssh/ssh_config
- /etc/ssh/sshd_config
- /etc/sysctl.conf
- /etc/syslog.conf
- /etc/syslog.d/devd.conf
- /etc/syslog.d/ntp.conf
- /etc/syslog.d/sudo.conf
- /etc/syslog.d/user.conf
- /etc/ttys
- OSのリビルド
- portsのインストール
前提条件
設定目標
- TCP輻輳制御はDC-TCPを使用する。
- 各種ログは1年間の保持を目指す。
- またログローテーション期間はよく使う物について、月一をベースに、出力が多いサービスでは1週間または1日で切り替えるものとする。
初期設定
/boot/loader.conf
--- /boot/loader.conf.orig 2021-02-25 04:30:48.435918000 +0900
+++ /boot/loader.conf 2021-02-25 07:03:15.844423000 +0900
@@ -5,6 +5,7 @@
zfs_load="YES"
nullfs_load="YES"
+cc_dctcp_load="YES"
geom_eli_load="YES"
vfs.root.mountfrom="zfs:zroot"
/etc/cron.d/portsupdate
#minute hour mday month wday who command 0 0 * * * root cd /usr/ports && sleep $(jot -r 1 0 86400) && (svnlite update && make index ) | logger -p user.notice -t ports-svn-update 2>&1
※2021年02月末日時点ではportsのGIT移行は未完了。
/etc/newsyslog.conf
--- /etc/newsyslog.conf.orig 2021-02-19 15:05:34.000000000 +0900
+++ /etc/newsyslog.conf 2021-02-25 08:13:00.228193000 +0900
@@ -16,21 +16,21 @@
#
# logfilename [owner:group] mode count size when flags [/pid_file] [sig_num]
/var/log/all.log 600 7 * @T00 J
-/var/log/auth.log 600 7 1000 @0101T JC
+/var/log/auth.log 600 53 * $W0D0 XC
/var/log/console.log 600 5 1000 * J
-/var/log/cron 600 3 1000 * JC
+/var/log/cron 600 12 * $M1D0 XC
/var/log/daily.log 640 7 * @T00 JN
/var/log/debug.log 600 7 1000 * JC
/var/log/init.log 644 3 1000 * J
/var/log/kerberos.log 600 7 1000 * J
-/var/log/maillog 640 7 * @T00 JC
-/var/log/messages 644 5 1000 @0101T JC
+/var/log/maillog 640 12 * $M1D0 XC
+/var/log/messages 644 12 1000 $M1D0 XC
/var/log/monthly.log 640 12 * $M1D0 JN
/var/log/devd.log 644 3 1000 * JC
-/var/log/security 600 10 1000 * JC
+/var/log/security 600 53 * $W0D0 XC
/var/log/utx.log 644 3 * @01T05 B
/var/log/weekly.log 640 5 * $W6D0 JN
-/var/log/daemon.log 644 5 1000 @0101T JC
+/var/log/daemon.log 644 12 * $M1D0 XC
<include> /etc/newsyslog.conf.d/[!.]*.conf
<include> /usr/local/etc/newsyslog.conf.d/[!.]*.conf
/etc/newsyslog.conf.d/ntpd.conf
# logfilename [owner:group] mode count size when flags [/pid_file] [sig_num] /var/log/ntpd.log 644 12 * $M1D0 XC
/etc/newsyslog.conf.d/ports-svn-update.conf
# logfilename [owner:group] mode count size when flags [/pid_file] [sig_num] /var/log/ports-svn-update.log 644 12 * $M1D0 XC
/etc/newsyslog.conf.d/sudo.conf
# logfilename [owner:group] mode count size when flags [/pid_file] [sig_num] /var/log/sudo.log 644 12 * $M1D0 XC
/etc/periodic.conf
daily_scrub_zfs_enable="YES" daily_status_zfs_enable="YES"
/etc/ssh/ssh_config
/etc/ssh/sshd_config
/etc/sysctl.conf
--- /etc/sysctl.conf.orig 2021-02-19 15:00:35.000000000 +0900
+++ /etc/sysctl.conf 2021-02-25 07:07:39.965363000 +0900
@@ -7,3 +7,6 @@
# Uncomment this to prevent users from seeing information about processes that
# are being run under another UID.
#security.bsd.see_other_uids=0
+
+net.inet.tcp.cc.algorithm=dctcp
+net.inet.tcp.ecn.enable=1
/etc/syslog.conf
/etc/syslog.d/devd.conf
!devd *.>=notice /var/log/devd.log
/etc/syslog.d/ntp.conf
ntp.* /var/log/ntpd.log
/etc/syslog.d/sudo.conf
/etc/syslog.d/user.conf
user.* /var/log/ports-svn-update.log
/etc/ttys
OSのリビルド
/etc/make.conf
OSの展開