Yep
tor 2006-08-17 klockan 22:49 +0300 skrev Martin Ivanov:
> And something else, that previously eluded from my thoughts:my "notifyme" 
> script,i.e the script that is executed at an ups.status="OB" event, is:
> echo `date` >> /root/upsLog
> echo "        No power, shutting down the system!" >> /root/upsLog
> sleep 30
> control=`/usr/local/ups/bin/upsc [EMAIL PROTECTED] ups.status`
> if [ $control != OL ]
> then
>  /usr/local/ups/sbin/upsmon -c fsd
> fi
> 
> I changed "telinit 0 " to "upsmon -c fsd", following the advice of Mr 
> Selinger from the mailing list. Besides, I added 
> "shutdownArguments={{1,0},y}" to ups.conf, as you advised me. With this 
> configuration, if the system works correctly, according to me things should 
> go like that in case of a prolonged power failure:
> power failure->ups.status=="OB"->"upsmon -c fsd"->system shutdown(normal 
> shutdown, involving runnint the shutdown scripts in rc.0->UPS shutdown one 
> minute after the "upsmon -c fsd" command was issued. I deliberately set one 
> minute time lapse between the issuing of the forced shutdown and the UPS 
> shutdown, so that there is enough time for the system to run the shutdown 
> scripts before shutting down. However, when I tested it, the system went 
> down, but the UPS did not. So I think the UPS doesnot recognise the "upsmon 
> -c fsd" command correctly. Am I right, or I am mistaken?
> 

The upsmon -c fsd is only issuing the shutdown to start.
It means that it generate a NOTIFY_SHUTDOWN and wait for
the finaldelay you have set the create the /etc/killpower
file then call the shutdown (telinit 0)

So it would not send the upsdrvctl shutdown. You have to
issue this command in your shutdown script.

>From http://eu1.networkupstools.org/doc/2.0.1/shutdown.html
-----------
2. Edit your shutdown scripts to check for the POWERDOWNFLAG so they
know
   when to power off the UPS.  You must check for this file, as you don't
   want this to happen during normal shutdowns!

   You can use upsdrvctl to start the shutdown process in your UPS 
   hardware.  Use this script as an example, but change the paths to
   suit your system:

   if (test -f /etc/killpower)
   then
        echo "Killing the power, bye!"
        /usr/local/ups/bin/upsdrvctl shutdown

        sleep 120

        # uh oh... the UPS poweroff failed!
        # you probably should reboot here to avoid getting stuck
        # *** see the section on power races below ***
   fi
---------

Regards
Kjell



_______________________________________________
Nut-upsuser mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser

Reply via email to