Installazione Nut su DNS-323
- Scaricare gli extra-packages
cd /mnt/HDa_2 rsync -av inreto.de::dns323/fun-plug/0.5/extra-packages .
- Installare le dipendenze:
cd /mnt/HD_a2/packages funpkg -i gd-2.0.35-1.tgz libjpeg-6b-1.tgz libpng-1.2.29-1.tgz neon-0.25.5-1.tgz ffp-base-0.5-1.tgz
- Installare nut
cd /mnt/HD_a2/extra-packages/All funpkg -i nut-2.4.1-1.tgz
- Preparare l'utente
groupadd nut adduser -s /bin/false -G nut -H nutmon store-passwd.sh
- scegliere come password NUTMonPW
- Configurare l'ups
export UPS_NAME="apc_backup_cs_350" export UPS_PASS="NUTMonPW" cp /ffp/etc/examples/nut/ups.conf.sample /ffp/etc/ups.conf
cat | sudo tee /ffp/etc/ups.conf > /dev/null <<EOFile
[$UPS_NAME]
driver = usbhid-ups
port = auto
EOFile
- Avviare il driver
/ffp/bin/upsdrvctl start
ATTENZIONE: lanciarlo con il percorso assoluto, altrimenti prende quello installato col firmware (il 2.2, che non va !)
- Configurare il demone:
cat | sudo tee /ffp/etc/upsd.conf > /dev/null <<EOFile LISTEN 0.0.0.0 3493 EOFile
chmod 640 /ffp/etc/upsd.conf
- Configurare gli utenti e le password:
cat | sudo tee /ffp/etc/upsd.users > /dev/null <<EOFile
[local_mon]
password = $UPS_PASS
upsmon master
EOFile
chmod 640 /ffp/etc/upsd.users
- Avviare il demone:
upsd
Network UPS Tools upsd 2.4.1 listening on 0.0.0.0 port 3493 Connected to UPS [apc_backup_cs_350]: usbhid-ups-apc_backup_cs_350
- se ci sono errori, prima di rilanciare upsd
killall upsd; upsd
- killare anche tutti gli altri pricessi *usb-hid*
- Verificare:
/ffp/bin/upsc -l
apc_backup_cs_350
/ffp/bin/upsc apc_backup_cs_350
....
- Configurare il monitor:
cat | sudo tee /ffp/etc/upsmon.conf > /dev/null <<EOFile
RUN_AS_USER nutmon
MONITOR ${UPS_NAME}@localhost 1 local_mon $UPS_PASS master
MINSUPPLIES 1
SHUTDOWNCMD "/ffp/sbin/poweroff"
POLLFREQ 5
POLLFREQALERT 5
HOSTSYNC 15
DEADTIME 15
POWERDOWNFLAG /etc/killpower
RBWARNTIME 43200
NOCOMMWARNTIME 300
FINALDELAY 5
EOFile
- lanciare il monitor
/ffp/sbin/upsmon
- Sistemare le permission
chown root:nut /ffp/etc/ups.conf /ffp/etc/upsd.conf /ffp/etc/upsd.users /ffp/etc/upsmon.conf chmod 0640 /ffp/etc/ups.conf /ffp/etc/upsd.conf /ffp/etc/upsd.users /ffp/etc/upsmon.conf chown root:nut /ffp/var/state/ups chmod 0770 /ffp/var/state/ups
- Creare lo startup file
ATTENZIONE: se il fw è 1.07 o partono degli usb-hid, usare l'altro file (http://wiki.dns323.info/howto:nut_ups?s=nut#automating_the_startup_process)
cat > /ffp/start/nut.sh <<'EOFile'
- !/ffp/bin/sh
- PROVIDE: nut
. /ffp/etc/ffp.subr
name="nut" start_cmd="nut_start" stop_cmd="nut_stop"
nut_start() { # Start NUT driver for UPS hardware. /ffp/bin/upsdrvctl start
# Start NUT Network Server /ffp/sbin/upsd
# Start NUT monitor agent /ffp/sbin/upsmon -u monuser }
nut_stop() { # Stop NUT monitor agent /ffp/sbin/upsmon -c stop
# Stop NUT Network Server /ffp/sbin/upsd -c stop
# Stop NUT driver for UPS hardware. /ffp/bin/upsdrvctl stop }
run_rc_command "$1" EOFile
- Renderlo avviabile
chmod a+x /ffp/start/nut.sh
- Avviarlo
/ffp/start/nut.sh restart
- Installare cleanboot
http://wiki.dns323.info/howto:cleanboot?s=cleanboot
wget "http://pof.eslack.org/dns323/cleanboot-2.1-ffp05.tgz" funpkg -i cleanboot-2.1-ffp05.tgz chmod a+x /ffp/start/cleanboot.sh /ffp/start/cleanboot.sh start