[Nut-upsuser] powercom UPS shoutdown discussion

Peter Selinger selinger at mathstat.dal.ca
Thu Aug 17 14:48:59 UTC 2006


Hi Martin,

as far as I can see, you should not use "/sbin/telinit" to shut down
the system in your notifyme script. You should use "upsmon -c
fsd". This is for two reasons: first, so that the powerdown flag is
set correctly. Second, in case there are any slaves attached to your
master upsmon (which may not be the case in your situation, but could
be the case in general), only "upsmon -c fsd" will do the correct
thing to shut them down in a controlled way.

See "FORCED SHUTDOWNS" on the upsmon(8) man page, and see also the
upssched(8) man page. 

By the way, seeing that you have effectively implemented a 30-second
timer to shut down on any battery event that is longer than 30
seconds, you probably should have used upssched(8); I am not very
familiar with it, but from looking at the man page (and that of
upssched.conf(8)), it seems that it was designed for exactly this
scenario.

-- Peter

Martin Ivanov wrote:
> 
> Thank you for your response.
> The point is that I have configured my system to shut down at the event "=
> upsc Inform at localhost ups.status"!=3D"OL", not at "LB". So there will be =
> no /etc/killpower file created. At an ups.status !=3D "OL" event, the fol=
> lowing script named "notifyme" is run:
> 
> echo `date` >> /root/upsLog
> echo "	No power, shutting down the system!" >> /root/upsLog
> sleep 30
> control=3D`/usr/local/ups/bin/upsc Inform at localhost ups.status`
> if [ $control !=3D OL ]
> then
>  /sbin/telinit 0
> fi
> 
> I tried adding the line: "touch /etc/powerdown" to the "notifyme" script =
> and the lines:
> 
> if (test -f /etc/powerdown)
> 	then
> 		echo "Killing the power, bye!"
> 		/usr/local/ups/bin/upsdrvctl shutdown
> 
> 		sleep 120
> 
> fi
> 
> to the /etc/rc.d/rc.6 script, but when I simulated a power failure, the s=
> ystem shut down, but the UPS did not. I think I did not add the lines at =
> the correct place in the rc.6 script, or probably there is poor communica=
> tion between the UPS and the software, for I am not sure the software I a=
> m using is for my UPS. I just found out that the powercom driver gives "O=
> L" when the UPS is connected to the mains, and "OB BOOST" when it is disc=
> onnected.
> Besides, I am not quite sure whether I need to make the UPS itself go dow=
> n in case of power failure, because if it does not go down, it has the ch=
> ance to get charged when power returns. Now after in case of power failur=
> e the PC shuts down and the UPS goes on buzzing, but it can go on buzzing=
>  like that for quite a lot time before the battery gets damaged, because =
> the PC is off and the power consumption from the UPS battery is minimal, =
> am I not right?=20
> So what would you recommend to me? MAke the UPS itself power off after sy=
> stem shutdown in case of power failure, or leave it buzzing till  power r=
> eturns?
> In case you advise me to make the UPS go down itself after the system shu=
> tdown, I will be thankful to you if you tell me  if the method I suggest =
> to achieve that is working and where in the shutdown script I need to add=
>  it?
> 
> Thank you for your responsiveness.
> Regards, Martin
> 
> 
>  >-------- =CE=F0=E8=E3=E8=ED=E0=EB=ED=EE =EF=E8=F1=EC=EE --------
>  >=CE=F2:  selinger at mathstat.dal.ca (Peter Selinger)
>  >=CE=F2=ED=EE=F1=ED=EE: Re: [Nut-upsuser] powercom user problem
>  >=C4=EE: tramni at abv.bg (Martin Ivanov)
>  >=C8=E7=EF=F0=E0=F2=E5=ED=EE =ED=E0: =D7=E5=F2=E2=FA=F0=F2=FA=EA, 2006, =
> =C0=E2=E3=F3=F1=F2 17 00:29:50 EEST
>  >----------------------------------
>  >
>  >Martin Ivanov wrote:
>  >>=20
>  >> 1. How to make the UPS power off after the PC powers off in case of p=
> ower
>  >>  failure. Of course when there is no power failure, but I issue shutd=
> own=20
>  >> command to the system, the UPS must not power off.
>  >
>  >The answer to this question in contained in the file INSTALL that is
>  >distributed with NUT. The answer is under "Configuring shutdowns for
>  >low battery events" -> "11. Edit your shutdown scripts: add upsdrvctl
>  >shutdown" (line 503).=20
>  >
>  >-- Peter
>  >
> 
> -----------------------------------------------------------------
> http://ide.li/ - =EF=EE=F0=F2=E0=EB =E7=E0 =E1=FA=EB=E3=E0=F0=E8=F2=E5 =EF=
> =EE =F1=E2=E5=F2=E0. =D1=F2=E0=F2=E8=E8, =ED=EE=E2=E8=ED=E8, =F4=EE=F0=F3=
> =EC=E8, =F1=ED=E8=EC=EA=E8, =E8=ED=F4=EE=F0=EC=E0=F6=E8=FF.
> 
> _______________________________________________
> Nut-upsuser mailing list
> Nut-upsuser at lists.alioth.debian.org
> http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser
> 




More information about the Nut-upsuser mailing list