[Nut-upsuser] Best practice to shutdown hosts which has not NUT via upssched
Roger Price
roger at rogerprice.org
Wed Jul 13 12:22:33 UTC 2016
On Wed, 13 Jul 2016, Dmitri Stepanov wrote:
>>> shutdown-all-hosts.sh contains:
>>> # Linux hosts
>>> HOSTLIST="sim iogate br"
>>> for host in $HOSTLIST
>>> do
>>> ...
>>> ssh $host halt -p
>>> ...
>>> done
>>> 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.
> 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...?
Without knowing the details of your system architecture, it looks as if
your system is very different from the typical case for which NUT is
intended. I'm assuming that your with-NUT machine is far away from the
"slaves" with an unreliable connection. In this case the "slaves" will
have to be autonomous and decide for themselves if and when they shut
down. I notice that you set up the SSH connection only when you want to
remotely order a slave shutdown. Perhaps in your case it would be better
to have the ssh link open all the time with a periodic "heartbeat" between
the no-NUT slaves and the master-with-NUT. In other words, sim, iogate and
br behave as masters, not slaves.
> It is not good to shutdown from CMDSCRIPT the master itself. Is it correct?
If the no-NUT machines were autonomous, then NUT is in charge of just the
with-NUT machine, and there is no problem with shutting down from the
CMDSCRIPT.
Could you build a local version of your setup for testing?
Roger
More information about the Nut-upsuser
mailing list