FreeBSD Tips

提供:雑多なメモ Wiki版

移動: 案内, 検索
FreeBSD on EC2 status
FreeBSD on EC2 FAQ

なので、いろいろまとめ中

FreeBSD AMI Recipe

本当にたんなるメモです。数字は意味ありません。

/boot/loader.conf

hint.acpi.0.disabled="1"
kern.maxusers=256
kern.ipc.nmbclusters=32768
kern.ipc.semmni="256"
kern.ipc.semmns="960"
/etc/make.conf

KERNCONF=GENERIC
WITHOUT_X11=yes
#WITHOUT_CDDL=yes
#X11BASE=/usr/local
EMACS_PORT_NAME=emacs21
SUP_UPDATE=     yes
SUPFLAGS=       -g -L 2
SUPHOST=        cvsup4.jp.freebsd.org
SUPFILE=        /usr/local/etc/cvsup/stable-supfile
PORTSSUPFILE=   /usr/local/etc/cvsup/ports-supfile
DOCSUPFILE=     /usr/local/etc/cvsup/doc-supfile
/etc/syslog.conf

touch /var/log/all.log
chmod 600 /var/log/all.log
*.*                                             /var/log/all.log
/etc/sysctl.conf

# FreeBSD-EN-09:05.null
security.bsd.map_at_zero=0

# Set it in case of large memory system.
vm.defer_swapspace_pageouts=1
vm.disable_swapspace_pageouts=1
vm.idlezero_enable=0
# Check vfs.ufs.dirhash_mem value
# (for NFS Server: 16777216 more, Web Server: 4194304)
#vfs.ufs.dirhash_maxmem=4194304
#vfs.ufs.dirhash_maxmem=16777216
#vfs.ufs.dirhash_maxmem=33554432
#vfs.ufs.dirhash_maxmem=67108864
# Shared Memory tweaking (see also /boot/loader.conf)
kern.ipc.shmmax=134217728
#kern.ipc.shmmax=1073741824
kern.ipc.shmall=32768
#kern.ipc.shmall=262144
kern.ipc.semmap=256
# See man tuning(7)
kern.maxfiles=65536
kern.maxfilesperproc=58982
kern.ipc.somaxconn=8192
kern.ipc.maxsockbuf=524280
# rfc1323
#net.inet.raw.maxdgram=16384
#net.inet.raw.recvspace=16384
#net.inet.tcp.sendspace=65536
#net.inet.tcp.recvspace=65536
#net.inet.udp.recvspace=65536
#net.inet.udp.maxdgram=16384
#
net.inet.icmp.icmplim=600
#net.inet.tcp.always_keepalive=0
#net.inet.tcp.msl=600
#net.inet.tcp.blackhole=2
#net.inet.udp.blackhole=1
# ICMP redirect off
net.inet.ip.redirect=0
net.inet6.ip6.redirect=0
net.inet6.icmp6.rediraccept=0
/etc/ssh/ssh_config

#ForwardAgent yes
#EnableSSHKeysign yes
TCPKeepAlive yes
ServerAliveInterval 15
ServerAliveCountMax 3
/etc/rc.conf

# HOST Settings
hostname="foo.bar.example.com"
ifconfig_em0="inet 192.168.1.3  netmask 255.255.255.0"
defaultrouter="192.168.1.254"

# Basic Settings
keyrate="fast"
keymap="jp.106"
saver="NO"
sshd_enable="YES"
usbd_enable="YES"
moused_enable="NO"
accounting_enable="YES"
ipv6_enable="NO"
icmp_drop_redirect="YES"
inetd_enable="YES"
inetd_flags="-wW -R 2048"
kern_securelevel_enable="NO"
fsck_y_enable="YES"
background_fsck="NO"
local_startup="/usr/local/etc/rc.d"

# BIND Settings
named_enable="YES"

# Sendmail Settings
sendmail_enable="YES"

# NTP Settings
ntpdate_enable="YES"
ntpdate_hosts="192.168.1.21"
ntpd_enable="YES"

# Ports Settings
snmpd_enable="YES"
snmpd_flags="-Lsd -Lf /dev/null"

# RPC Settings
rpcbind_enable="NO"

(特殊設定)

diff /usr/include/sys/socket.h /usr/src/sys/sys/socket.h
diff /usr/include/sys/select.h  /usr/src/sys/sys/select.h
4096
8192U
いま -> RELENG_7 -> RELENG_8
/boot/device.hints
hint.uart.0.*
WITHOUT_CDDL=yes
http://www.mail-archive.com/freebsd-stable@freebsd.org/msg91065.html
http://www.freebsd.org/cgi/query-pr.cgi?pr=148538
net-mgmt/tcptrack
sysutils/smartmontools

perl5.10 に上げたときいろいろ発見した件

libchk

とか

portsclean -L
/usr/local/libdata/ldconfig/

# /etc/rc.d/ldconfig start

あーやっぱり FreeBSD が大好きです。

tzsetup(8)
うれしす
要注意
Firefox 3.5 and HTML5

Certain functions used to display HTML5 elements need the sem module.

If your Firefox crashes with the following message while viewing a
HTML5 page:
"Bad system call (core dumped)"

you need to load the sem module (kldload sem).

To load sem on every boot put the following into your
/boot/loader.conf:
sem_load="YES"
portsnap fetch
portsnap extract
portsnap update
portsnap fetch
portsnap update
ezjail-admin update -P
ついでに freebsd-update 系メモ
projects: freebsd-update-server
watch @Linux ===> sysutils/topless @FreeBSD
ps auxf @Linux ===> sysutils/pstree @FreeBSD
CGI 等で sendmail を起動する際 -f を指定しなかった場合の sender の挙動とかとか
id -p
で確認してみそ
apache を起動する時に id -p して、login という項目が表示されていればビンゴ!
(see man 2 setlogin, getlogin)
(そーいやぁ 昔は exec login しろっていってたよなぁ...)
(*BSD のシステム運用の際は今も昔も要注意)
FreeBSD の devfs 系
/sbin/devfs rule -s 1 delset
/sbin/devfs rule -s 1 add hide
/sbin/devfs rule -s 2 delset
/sbin/devfs rule -s 2 add path null unhide
/sbin/devfs rule -s 2 add path zero unhide
/sbin/devfs rule -s 2 add path crypto unhide
/sbin/devfs rule -s 2 add path random unhide
/sbin/devfs rule -s 2 add path urandom unhide
/sbin/devfs -m /foo_chrootdir/dev ruleset 1
/sbin/devfs -m /foo_chrootdir/dev rule applyset
/sbin/devfs -m /foo_chrootdir/dev rule -s 2 applyset
/sbin/devfs rule showsets
/sbin/devfs rule -s 1 show
/sbin/devfs rule -s 2 show
extended rc 系では
umount /foo_chrootdir/dev 2>/dev/null
devfs_domount /foo_chrootdir/dev devfsrules_hide_all
devfs -m /foo_chrootdir/dev rule -s 2 applyset
rulesetは rcvar の 'devfs_rulesets' で定義
(増加する ttyp*, ptyp* も hide (謎))
/usr/ports/hoge/fugaで
Makefile.local
scripts/ほげら
を駆使してなんとかする
(ほげら: 最後に独自パッチをあてたければ、post-patch とか)
(Makefile.local も scripts/以下 も make update では消えないので安心)

過去ログ

昔のものは、雑多なメモ

個人用ツール
名前空間
変種
操作
案内