ほっしーの技術ネタ備忘録

技術ネタの備忘録です。基本的に私が忘れないためのものです。他の人の役にも立つといいなぁ。

snmpd がなぜか起動しない


表題の通り、FreeBSD 起動時に自動で起動するはずの snmpd が起動しない。


しかもコンソールから

$ sudo /usr/local/etc/rc.d/snmpd start

って打つと正常に起動する。


おっかしーなー……


と今までずっと思っていたのですが。
何のことはない、/usr/local/etc/rc.d/ 以下のスクリプト
.sh のサフィックスを持つファイル以外は無視するようです。

The following key points apply to old-style scripts in
/usr/local/etc/rc.d/:

Scripts are only executed if their basename(1) matches the shell
globbing pattern *.sh, and they are executable. Any other files or
directories present within the directory are silently ignored.

FreeBSD man rc の項より引用。


おそらく net-snmp 4 からバージョンアップしたときにそのまま取り残されたようです。

$ ls /usr/ports/net-mgmt/net-snmp/files/snmpd.sh.in
/usr/ports/net-mgmt/net-snmp/files/snmpd.sh.in
$

ちゃんと .sh プレフィックスが付いています。