Как правильно готовить apcupsd
Victor Sudakov написал(а) к Semen Panevin в May 19 22:22:30 по местному времени:
Dear Semen,
02 May 19 08:23, you wrote to me:
[dd]
VS>> последним перед halt? Можно посмотреть на него?
SP> # cat /etc/init.d/apcupsd.powerfail
Да, а чем обеспечивается, что данный скрипт запускается всегда последним перед halt?
SP> #!/sbin/openrc-run
SP> # Copyright 2009 Gentoo Foundation
SP> # Distributed under the terms of the GNU General Public License v2
SP> description='Signal the UPS to kill power in a power failure
SP> condition'
SP> depend() {
SP> need mount-ro
SP> }
SP> start() {
SP> if [ "$(runlevel | cut -d' ' -f2)" = "0" -a -f
SP> /etc/apcupsd/powerfail ] ; then
SP> ebegin 'Signaling UPS to kill power'
SP> /sbin/apcupsd --killpower
SP> eend $?
SP> fi
SP> }
Victor Sudakov, VAS4-RIPE, VAS47-RIPN
--- GoldED+/BSD 1.1.5-b20160322-b20160322
|