CONTENTS #contents ---- Lastmodified &lastmod; ---- https://www.google.co.jp/#lr=lang_ja&tbs=lr:lang_1ja&q=FreeBSD+%2Fetc%2Frc.conf+em0+tso http://matsup.blogspot.jp/2012/12/freebsd-90-ipfw-natd-em.html http://www.bsddiary.net/d/20100324.html *DEVD [#j15b0458] NEC Express5800/GT110b **オンボードNIC em0 が高負荷で落ちるので、これを監視して落ちたらシステム・リブートさせたい。 [#q26ec835] FreeBSD 10.2-Rから 11.0-CURRENTへ変更したけど、やっぱり落ちる。ということで、devdを使って見ることにした。 http://www.yosbits.com/opensonar/rest/man/freebsd/man/ja/man5/devd.conf.5.html http://www.on-sky.net/~hs/misc/?Raspberry+Pi+HA+Server+with+FreeBSD http://www.yosbits.com/opensonar/rest/man/freebsd/man/ja/man8/devd.8.html?l=ja devdはシステムに初めから入っているので、 /etc/rc.conf devd_enable="YES" として起動するように設定。 **監視対象とアクションを設定。 [#w2f0b681] /etc/devd/em0.conf #system=IFNET, subsystem=fxp0, type=LINK_UP notify 0 { match "system" "IFNET"; match "subsystem" "em0"; match "type" "LINK_DOWN"; action "/root/bin/reboot.sh"; }; /root/bin/reboot.sh #!/bin/sh tail -100 /var/log/all.log | mail -s "System was Rebooted" root@localhost \ && /sbin/reboot リブート用のスクリプトを書いておく。改行コードがLFでないと動かないので注意。 読み込むかどうかテスト root@blackhole:~ # devd -d Parsing /etc/devd.conf setting scsi-controller-regex=(aac|adv|adw|aha|ahb|ahc|ahd|aic|amd|amr|asr|bt|ciss|ct|dpt|esp|ida|iir|ips|isp|mlx|mly|mpt|ncr|ncv|nsp|stg|sym|trm|wds)[0-9]+ setting wifi-driver-regex=(ath|bwi|bwn|ipw|iwi|iwm|iwn|malo|mwl|ral|rsu|rum|run|uath|upgt|ural|urtw|urtwn|wi|wpi|wtap|zyd)[0-9]+ Parsing files in /etc/devd Parsing /etc/devd/em0.conf Parsing files in /usr/local/etc/devd devd: Can't open devctl device /dev/devctl: Device busy 起動中のdevdの順番は出来るだけ遅い方がよさげ(NICがLink_UPしてからでないと無限リブートになる)なので、 /etc/rc.d/devd # REQUIRE: netif ldconfig ntpd を追加して #!/bin/sh # # $FreeBSD: head/etc/rc.d/devd 282145 2015-04-28 13:13:23Z glebius $ # # PROVIDE: devd # REQUIRE: netif ldconfig ntpd # BEFORE: NETWORKING mountcritremote # KEYWORD: nojail shutdown : : としてみる。 ---- Total access &counter(total);:本日 &counter(today);:昨日 &counter(yesterday); #counter([total|today|yesterday]);