AutoStarter Project
In the Unix world starting several applications remotely on different machines is a simple task which can be done easily via SSH/rlogin services. But in pure Windows environments this can be challenging, especially when running programs must be monitored and have to be restarted after they crashed or be closed accidently.
The goal of the AutoStarter Project is to simplify starting, stopping and monitoring applications which are running on different machines in the network.
To achieve this goal the project comes with two applications:
AutoStarter
The AutoStarter Client is able to read a list of programs belonging to a distributed application. This list is saved in a file with a specific XML format. Programs in this list will be started or stopped automatically on their associated machines. Several distributed programs can be started and controlled at the same time.
The corresponding C# project can also be used as a backend for your own GUI application allowing you to build your own starter program for distributed application. A sample GUI program called DemoStarter can be found in the zip file.
ASDaemon
To be able to start an application remotely, every computer needs an ASDaemon - a server which will receive commands from the AutoStarter Client to start or stop a processes.
Features
- Starting and stopping applications remotely
- Use the AutoStarter as a backend for your own solution to start and control distributed applications
- Monitoring ability, you will receive warnings if programs crash or can't be executed
- Define several distributed applications and manage them with a single program
Introduction
This is a small introduction, which will show you how to use AutoStarter to execute your own applications remotely on different machines. For more details please refer to the Readme in the zip file.
Let's examine the following scenario:
You are on an exhibition and have three machines, on two of them you want to run a video presentation and the third one needs to execute a batch script after the videos are running. Usually you have to connect to these machines by VNC or a similar method and start and stop all applications for yourself. This small HowTo shows you how the AutoStarter can be used to do the same task in a much easier way:
1. First we have to create a file containing all informations about the applications we want to run. For our scenario it could look like this:
---- presentation.xml -----
<?xml version="1.0" ?>
<!DOCTYPE appgroup SYSTEM "autoscript.dtd">
<appgroup id="presentation">
<!--
First we are starting mplayer on the machine 192.168.0.2
playing Video1.avi. Every application gets his own id, in this
case we call the program just "bigScreen" because this is the
place the video will be shown. Each id must of course be unique within a
single xml file.
-->
<run
id = "bigScreen"
file = "C:\Exhibition\Mplayer\mplayer.exe
args = "C:\Exhibition\Data\Video1.avi"
ip = "192.168.0.2"
/>
<!--
The second step is nearly the same as above, but we are
now waiting 200 milliseconds before executing the next xml node.
-->
<run
id = "smallScreen"
file = "C:\Exhibition\Mplayer\mplayer.exe
args = "C:\Exhibition\Data\Video1.avi"
ip = "192.168.0.3"
waitms = "200"
/>
<!--
This node will run cmd.exe to interprete start.bat, the
working directory is automatically set to "C:\Exhibition\Demo",
but can be set manually to another directory with the "workingDir"
option. Two arguments are passed to the batch script, the first
is "-l" the second one is: -s "Demo1"
Dont' forget to use proper xml tags for apostrophe and ampersand if you have
to pass command line arguments.
-->
<run
id = "demoProgram"
file = "C:\Exhibition\Demo\start.bat
args = "-l -s "Demo1""
ip = "192.168.0.4"
/>
</appgroup>
-------------------------------
2. In a second step we store a copy of ASDaemon.exe on each PC (192.168.0.{2,3,4}) and execute it.
3. We can now run AutoStarter.exe on any computer in the same network. After starting the application you will see a command prompt. Use "help" to get a list of available commands.
4. Type "runapp C:\PathTo\presentation.xml" to execute the applications defined in the given xml file. Please make sure the dtd file referred by the xml file really exists in the given path.
5. Try the following commands:
"list" will show all active scripts ... in this case it's just presentation.xml (id = presentation")
"list presentation" will show all programs executed in the context of this script
"verbose" to get more informations about what is going on
6. To close the video applications or the program executed by the batch file you can use "killall" or "kill ScriptId:ProgramId" to close just one specific process. If you want to close the video presentation on the small screen for example, you can type in "kill presentation:smallScreen"
To test the applications you can run the ASDaemon on your local computer as well as the AutoStarter and execute "Test.xml" (included in the ZIP file) which will open three console windows.
AutoStarter Download
The application is published under the terms of the GPLv3 licence.
Contact Information
Feel free to send us your questions at daniel.kaes@dai-labor.de.

