last-modified: 2019-04-28 (日) 18:36:58 (1834d)[変更箇所]
APC製のUPSからPCに命令を送るためのソフト。 http://www.apcupsd.com/ が本家。
以下インストールや設定のメモ
ソースをダウンロードして展開。 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
でデーモン起動する。
/etc/apcupsd/apcupsd.confを編集する。 詳細は本家ページのmanualを見るべき。 以下は主なパートの簡単な説明。
apcupsdはshutdownの命令を/etc/apcupsd/apccontrolというスクリプトを使用しているッぽいが、そこでのshutdownのpath。 デフォルトは/usr/bin/shutdownとなっていた。 UPSへの電力供給をやめたときにshutdownのメッセージは出てもPCのshutdownができなかった。/usr/bin/shutdownを/sbin/shutdownにしたらうまくいった!
2台以上をshutdownする時はどう設定する? USBハブを通してしまえばよいの?