FreeAXP - Run as a service

  • NeonJack
  • Topic Author
  • Visitor
  • Visitor
12 years 2 weeks ago #5159 by NeonJack
Replied by NeonJack on topic RE: FreeAXP - Run as a service
< class='quote'>[b:]NeonJack wrote:[/b:]
Following on from this, what would be particularly nice would be to intercept machine shutdown (or shutdown and restart) so that putty can be configured to logon to the console (OPA0) as system and issue a shutdown command, followed by a console firmware exit, before the host machine finally shuts up.

I am looking into this, but if anybody has the answer that would be great.<img src='../images/smiley/smile.gif' alt='smiley'>

I have found a solution to this:-
You need ExtraPuTTY which has a script facility. Set the script to login to the system console as SYSTEM and then issue a SHUTDOWN command. put a 40 second or so wait command in then issue 'exit' (without quotes) at the firmware console prompt to make the emulator itself spindown. Windows will then stop the service as part of its shutdown.
Then, you create a batch file that calls putty (from the &#92;extraputty&#92; directory) on the command line, specify -load "name of session" -startup "name of shutdown script" and then put this batch file into the shutdown files (searchon the Internet for "adding Windows shutdown tasks" to find out how to do this) so that it executes before Windows completes its shutdown.

Note that FreeAXP as a service relies on you not needing to change the configuration interactively, so, for example, it's no good putting in a "ask at runtime" selection for the NIC to use when FreeAXP starts running..<img src='../images/smiley/smile.gif' alt='smiley'>

Please Log in or Create an account to join the conversation.

  • lottabull
  • Topic Author
  • Visitor
  • Visitor
11 years 9 months ago #5160 by lottabull
Replied by lottabull on topic RE: FreeAXP - Run as a service
NeonJack, could you post a redacted copy of the (LUA?) login-and-shutdown script?

Please Log in or Create an account to join the conversation.

  • NeonJack
  • Topic Author
  • Visitor
  • Visitor
11 years 8 months ago #5161 by NeonJack
Replied by NeonJack on topic RE: FreeAXP - Run as a service
Yes here we are:-

&lt;?xml version="1.0"?&gt;
&lt;!--Registry file for ExtraPuTTY, Copyright 2011--&gt;
&lt;ExtraPuTTYTreeCmd&gt;
&lt;Position name="ExtraPuTTY" use="0"&gt;
&lt;btlr name="bottom" value="0"/&gt;
&lt;btlr name="top" value="0"/&gt;
&lt;btlr name="left" value="0"/&gt;
&lt;btlr name="right" value="0"/&gt;
&lt;/Position&gt;
&lt;Position name="PuTTY" use="0"&gt;
&lt;btlr name="bottom" value="0"/&gt;
&lt;btlr name="top" value="0"/&gt;
&lt;btlr name="left" value="0"/&gt;
&lt;btlr name="right" value="0"/&gt;
&lt;/Position&gt;
&lt;Options Locked="0"/&gt;
&lt;root name="Shutdown" RGB="16711680" lfHeight="-12" lfWidth="0" lfEscapement="0" lfOrientation="0" lfWeight="700" lfItalic="255" lfUnderline="1" lfStrikeOut="0" lfCharSet="0" lfOutPrecision="3" lfClipPrecision="2" lfQuality="1" lfPitchAndFamily="34" lfFaceName="Arial"&gt;
&lt;childroot name="doShutup" type="2" loop="1" auto="0" RGB="128" lfHeight="-12" lfWidth="0" lfEscapement="0" lfOrientation="0" lfWeight="700" lfItalic="255" lfUnderline="0" lfStrikeOut="0" lfCharSet="0" lfOutPrecision="3" lfClipPrecision="2" lfQuality="1" lfPitchAndFamily="34" lfFaceName="Arial"&gt;
&lt;childscenarii name="login" cmd=" " tempo="1000" mode="execute" CRLF="1" RGB="0" lfHeight="-12" lfWidth="0" lfEscapement="0" lfOrientation="0" lfWeight="400" lfItalic="0" lfUnderline="0" lfStrikeOut="0" lfCharSet="0" lfOutPrecision="3" lfClipPrecision="2" lfQuality="1" lfPitchAndFamily="34" lfFaceName="Arial"/&gt;
&lt;childscenarii name="username" cmd="SYSTEM" tempo="1000" mode="execute" CRLF="1" RGB="0" lfHeight="-12" lfWidth="0" lfEscapement="0" lfOrientation="0" lfWeight="400" lfItalic="0" lfUnderline="0" lfStrikeOut="0" lfCharSet="0" lfOutPrecision="3" lfClipPrecision="2" lfQuality="1" lfPitchAndFamily="34" lfFaceName="Arial"/&gt;
&lt;childscenarii name="pwd" cmd="put_your_login_password_here" tempo="1000" mode="execute" CRLF="1" RGB="0" lfHeight="-12" lfWidth="0" lfEscapement="0" lfOrientation="0" lfWeight="400" lfItalic="0" lfUnderline="0" lfStrikeOut="0" lfCharSet="0" lfOutPrecision="3" lfClipPrecision="2" lfQuality="1" lfPitchAndFamily="34" lfFaceName="Arial"/&gt;
&lt;childscenarii name="issue shutdown command" cmd="SHUTDOWN" tempo="1000" mode="execute" CRLF="1" RGB="0" lfHeight="-12" lfWidth="0" lfEscapement="0" lfOrientation="0" lfWeight="400" lfItalic="0" lfUnderline="0" lfStrikeOut="0" lfCharSet="0" lfOutPrecision="3" lfClipPrecision="2" lfQuality="1" lfPitchAndFamily="34" lfFaceName="Arial"/&gt;
&lt;childscenarii name="send CRLF" cmd=" &lt;VK_RETURN&gt;" tempo="30000" mode="execute" CRLF="1" RGB="0" lfHeight="-12" lfWidth="0" lfEscapement="0" lfOrientation="0" lfWeight="400" lfItalic="0" lfUnderline="0" lfStrikeOut="0" lfCharSet="0" lfOutPrecision="3" lfClipPrecision="2" lfQuality="1" lfPitchAndFamily="34" lfFaceName="Arial"/&gt;
&lt;childscenarii name="send CRLF" cmd=" &lt;VK_RETURN&gt;" tempo="30000" mode="execute" CRLF="1" RGB="0" lfHeight="-12" lfWidth="0" lfEscapement="0" lfOrientation="0" lfWeight="400" lfItalic="0" lfUnderline="0" lfStrikeOut="0" lfCharSet="0" lfOutPrecision="3" lfClipPrecision="2" lfQuality="1" lfPitchAndFamily="34" lfFaceName="Arial"/&gt;
&lt;childscenarii name="firmware exit" cmd="exit" tempo="1000" mode="execute" CRLF="1" RGB="0" lfHeight="-12" lfWidth="0" lfEscapement="0" lfOrientation="0" lfWeight="400" lfItalic="0" lfUnderline="0" lfStrikeOut="0" lfCharSet="0" lfOutPrecision="3" lfClipPrecision="2" lfQuality="1" lfPitchAndFamily="34" lfFaceName="Arial"/&gt;
&lt;/childroot&gt;
&lt;/root&gt;
&lt;/ExtraPuTTYTreeCmd&gt;


It's not infallible but seems to work well when running as part of the Windows Shutdown procedure as I explained earlier.

Most of the time it works OK when the host user is logged in, but it doesn't always work very well as part of a standalone Scheduler task...

Please Log in or Create an account to join the conversation.

Moderators: iamcamiel
Time to create page: 0.210 seconds
Powered by Kunena Forum