Problem: the electric company often cuts power here either for 10
minutes or for the whole day. One can only guess what it will be.
With both my monitor and computer on, my UPS can only last 5 minutes,
but with the monitor off, the UPS can last 20 minutes. (No, I have the
most basic UPS with no com port hook up.)
I could hit the plastic button on my monitor to turn it off, but if
power is restored, then it is a shame to have turned it on and off:
wear and tear. Best would to be to put it into a standby mode. Then
if 15 minutes have gone by, go into shutdown via script, without
reviving the monitor via keyboard actions. However I am having
trouble writing this.
xset dpms force standby #works, but monitor gets turned on again when X
#exits during shutdown! How to stop that?
#Ok, try from plain tty1 or after "init 1", on /dev/console:
setterm -powersave powerdown #no effect, and no error message
echo -e "\033[9;0]\033[14;0]" >/dev/console #again, no effect
sleep 900 #interrupt with ^C if I notice power is restored
shutdown -h now
#I have a Lemel 15+ monitor, OS: debian woody
By the way, on the debian-user list there was a response:
csj> Same power problemo here. I found my solution a few months ago. I
csj> installed emacs + emacspeak + flite + eflite (needs a few bits of
csj> non-automatic configuring). Emacspeak lets you compute without a
csj> monitor! In my case it lets me do basic computer administration. When a
csj> power outage hits I set my terminal (window or tab) to an emacs(peak)
csj> shell and promptly turn off the monitor. If the power isn't restored
csj> within say 10 mins, I can su to root and issue the shutdown
csj> command.
Yes, but you still physically (push the button) turn off the monitor.
You have not managed to shutdown without somehow waking up the
monitor, so you must physically turn it off.
I don't need to touch the keyboard again. My script will do the
shutdown in 10 minutes. I just can't figure out to run the shutdown
command without waking up the monitor.
--
http://jidanni.org/ Taiwan(04)25854780