[Nut-upsuser] Best practice to shutdown hosts which has not NUT via upssched

Dmitri Stepanov dstep at mail.ru
Wed Jul 13 10:46:31 UTC 2016


Thank you for answer Roger

>Среда, 13 июля 2016, 11:49 +03:00 от Roger Price <roger at rogerprice.org>:
>
>On Wed, 13 Jul 2016, Dmitri Stepanov wrote:
>
>> Hi
>>
>>    I need to shutdown a number of hosts which has not NUT from one which has it.
>>
>>    I tried to do it from upssched script (after upssched's timer) like this:
>>
>> case $1 in
>>         earlyshutdown)
>>                 logger -t upssched-cmd "Early shutdown is started"
>>                 /bin/sh /usr/local/sbin/shutdown-all-hosts.sh
>>                 /usr/local/sbin/upsmon -c fsd
>>                 ;;
>> esac
>>
>>    shutdown-all-hosts.sh contains:
>> # Linux hosts
>> HOSTLIST="sim iogate br"
>> for host in $HOSTLIST
>> do
>> ...
>>      ssh $host halt -p
>> ...
>> done
>> # Windows hosts
>> ssh shut at com "shutdown -s -t 0"
>>
>>    shutdown-all-hosts.sh works fine if it runned manually.
>>    But it does not work even if I insert sleep 30 sec before upsmon -c fsd
>
>When you say "it does not work", what are the symptoms? Does 
>shutdown-all-hosts.sh get called?

System has installed far away (in China) and there is bad Internet connection, so I might have ability to connect and check log files in a few day or weeks. Now I know exactly only that NUTed hosts shutdown via NUT as expected and no one host listed in shutdown-all-hosts.sh script don't.

>
>>    Also I read somewhere that it is not a good idea to shutdown other hosts from the CMDSCRIPT.
>
>The User Manual chapter 7.2:
>
><< It’s not a good idea to call your system’s shutdown routine directly 
>from the CMDSCRIPT, since there’s no synchronization with the slave 
>systems hooked to the same UPS. FSD is the master’s way of saying "we’re 
>shutting down now like it or not, so you’d better get ready". >> 
>http://networkupstools.org/docs/user-manual.chunked/ar01s07.html

It is not good to shutdown from CMDSCRIPT the master itself. Is it correct?

>
>If you want to shutdown your slave systems siom, iogate and br from the 
>CMDSCRIPT, you will need to of "slaves first", 
>then the master.  Your current protocol does not check that the slaves are 
>indeed shutting down.

Roger, I would appreciate if you give me a hint how to "reproduce the NUT protocol ... ". Do you mean getting feedback to CMDSCRIPT about the "no NUTed" slaves indeed shutting down and/or some timing in NUT config files...?

>
>Roger
>_______________________________________________
>Nut-upsuser mailing list
>Nut-upsuser at lists.alioth.debian.org
>http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/nut-upsuser



More information about the Nut-upsuser mailing list