Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
139 user(s) are online (133 user(s) are browsing Forums)

Members: 2
Guests: 137

ktadd, MartinW, more...

Support us!

Headlines

 
  Register To Post  

Power Off script for A1222+
Just popping in
Just popping in


See User information
I didn't see a forum for script kiddies. ;)

I have grown accustomed to remote power on and off for my X1000.
On by a small remote control mounted behind my monitor, and off by the "poff" shell command.

If I had a nickel for every time I've tried to "poff" the A1222, always getting "this model is not supported" or something like that.

So here's a little script to fix that. Just save this as s:shell/poff, then protect it with "protect s:shell/poff +s".

echo "Power Off in two seconds"
Wait 2
echo >SER1:BAUD=38400/CONTROL=8N1/UNIT=1" "#s"


That's it! Obviously you could snap it off immediately without the Wait, but I did manage to invalidate my SYS: once that way, so perhaps letting the bits settle for two seconds might be preferable.

Not a big deal, but it might be handy for someone.

LyleHaze

Go to top
Re: Power Off script for A1222+
Just popping in
Just popping in


See User information
Oops, I missed a Quote.
Trying again:

echo "Power Off in two seconds"
Wait 2
echo >"SER1:BAUD=38400/CONTROL=8N1/UNIT=1" "#s"


That should work better.

Go to top
Re: Power Off script for A1222+
Just can't stay away
Just can't stay away


See User information
@LyleHaze
IIRC the delay between the last write to a partition and flushing it's caches to the disk can be 5 seconds, better increase the number of seconds in the Wait command.

Go to top
Re: Power Off script for A1222+
Just can't stay away
Just can't stay away


See User information
I'm not sure how the wait command is possibly helping here. It surely has no effect on anything else running. Isn't echo resident? If not, running echo doesn't write anything to disk does it? (except when using a redirection to a file)

Go to top
Re: Power Off script for A1222+
Just can't stay away
Just can't stay away


See User information
@MickJT
Echo doesn't delay anything nor write anything to the disk, and the Wait doesn't stop other running tasks from writing something to the disk. But if you start that "poff" shell script after stopping all applications which could write something to the disk you still have to wait up to 5 seconds before everything which may have been written to the partitions by those other, stopped applications was actually written to/copied back from caches to the disk before switching off the machine.

Go to top
Re: Power Off script for A1222+
Just can't stay away
Just can't stay away


See User information
@LyleHaze

Hi, you mean this POff?
http://os4depot.net/?function=showfile&file=utility/shell/poff.lha

So drop me a PM and will send you some test/beta.

TiA

Go to top
Re: Power Off script for A1222+
Just popping in
Just popping in


See User information
Your comments on the delay make sense.
Even waiting five seconds is a poor substitute for actually inhibiting drive activity, then waiting for a proper response.

I originally ran it with no delay, and had to wait out a long validation on my next boot.

but it was wicked fast!

I'll look into a better way to verify that all disk io is completed.

Lyle

Go to top
Re: Power Off script for A1222+
Site Builder
Site Builder


See User information
Great script. Should the disks be unmounted first before the poweroff, to make sure that no data writing is in progress?

Follow me on
Ko-fi, Twitter, YouTube, Twitch
Go to top
Re: Power Off script for A1222+
Not too shy to talk
Not too shy to talk


See User information
@jabiruloQuote:
jabirulo wrote:@LyleHaze

Hi, you mean this POff?
http://os4depot.net/?function=showfile&file=utility/shell/poff.lha

So drop me a PM and will send you some test/beta.


would also be nice for the x5000 - hint!
we only have the workbench shutdown menu here. no external tool which can handle it.

regards...
michael

Go to top
Re: Power Off script for A1222+
Just can't stay away
Just can't stay away


See User information
@MichaelMerkel

check mail

Go to top
Re: Power Off script for A1222+
Just popping in
Just popping in


See User information
it seems that Poff works with the a1222, I had an older version.
and the sync option protects drives from shutdown during writes.. definitely useful.

so my little hack was fun, but there is a better way.

thanks all.

Go to top
Re: Power Off script for A1222+
Just popping in
Just popping in


See User information
First: The way this shuts down without inhibiting drives is dangerous, and so I have to suggest never using this.

Second: I just got a copy of the Cyrus manual, and it appears this will work for that too. Maybe, untested.

BUT since Poff now works through acpi.resource, AND it offers a sync option, that seems a much safer way of doing things..

End Result: Cute hack but not a great idea, use proper tools instead!

Lyle

Go to top

  Register To Post

 




Currently Active Users Viewing This Thread: 2 ( 0 members and 2 Anonymous Users )




Powered by XOOPS 2.0 © 2001-2024 The XOOPS Project