* apcupsd [#be5db7f7]
APC製のUPSからPCに命令を送るためのソフト。
http://www.apcupsd.com/
が本家。
以下インストールや設定のメモ
** インストール [#g39ac270]
ソースをダウンロードして展開。
USBでPCとつなぐときにはconfigureの時にオプションを付ける必要あり。
(defaultではdisableらしい。)
./configure --enable-usb
make
make install (rootでやる)
エラーなくコンパイルできた。/sbin/apcupsdができるが、
/etc/rc.d/init.d/にスクリプトできていない。
In addition, if your system is recognized, certain files
such as the startup script and the system halt script will
be placed in appropriate system directories (usually
subdirectories of /etc/rc.d)
とある。インストールでsystemを認識できていないらしい。
ただまあとりあえず
/sbin/apcupsd
でデーモン起動する。
**設定 [#n64d50ff]
/etc/apcupsd/apcupsd.confを編集する。
詳細は本家ページのmanualを見るべき。
以下は主なパートの簡単な説明。
- TIMEOUT AA(sec) : UPSがバッテリー使用開始してAA秒後にPCをshutdownする
- BATTERYLEVEL AA(%): 停電中にUPSのバッテリー残量がAA%になるとPCをshutdownする。AA=-1で無効化
- MINUTES AA(min) : 停電中の残り供給時間がAA分を切るとshutdownする。AA=-1で無効化。
- BEEPSTATE [0|T|L|N]: ビープ音の設定。停電中はうるさいので、Nにする。Nにすると鳴らさない。
***うまくいかないときには? [#a9c60cea]
apcupsdはshutdownの命令を/etc/apcupsd/apccontrolというスクリプトを使用しているッぽいが、そこでのshutdownのpath。
デフォルトは/usr/bin/shutdownとなっていた。
UPSへの電力供給をやめたときにshutdownのメッセージは出てもPCのshutdownができなかった。/usr/bin/shutdownを/sbin/shutdownにしたらうまくいった!
**疑問 [#ve77708e]
2台以上をshutdownする時はどう設定する?
USBハブを通してしまえばよいの?