Installing ATS as a Service

To allow ATSD to run as a standard service and be controlled by the Windows Services Applet, we provide a module named ATSDSRV.EXE which acts as a service "wrapper", essentially just launching ATSD.EXE. Before installing or launching ATSDSRV.EXE, you must edit the initialization file ATSDSRV.INI (which should be in the same directory as ATSDSRV.EXE.) The typical INI file (which you can edit with Notepad) looks like this:

[Settings]

ServiceName=A-Shell Telnet Server (ATS)

CheckProcessSeconds = 30

 

 

[Process0]

CommandLine=c:\vm\miame\bin\atsd.exe –z -i c:\vm\miame\miame.ini -a c:\vm\miame\bin\ashw32.exe start

PauseStart=1

PauseEnd=1

UserInterface=Yes

Restart=Yes

UserName=

Domain=

Password=

 

The only two parameters which you are likely to want to change are the CommandLine (see the previous section for details about the ATSD command line options) and UserInterface. If UserInterface=Yes, then ATSD.EXE will be launched in the system tray (if the –z switch specified) or in a normal window (allowing you to see how many connections it has made, etc.) If you UserInterface=No, then it will be launched in background, more in line with the way other services run. You could also change the name of the service (ServiceName=) to match the name of your application if you like.

The CheckProcessSeconds parameter indicates how often we check to see that the service is still running. If it stops, and the Restart option is set to Yes, then it will be automatically restarted.

The UserName, Domain, and Password options allow you to make the service (and more importantly, the A-Shell sessions spawned by it) run with the specified user credentials, rather than the standard System user. (Since the password is plain text, you may want to launch the service from another directory that is protected.) You can also accomplish the same thing via the dialogs in the Services Manager.

After editing your ATSDSRV.INI file, the next step is to "install" the service, which you can do from the Start...Run dialog with the following command

c:\vm\miame\bin\atsdsrv -i

(Replace c:\vm\miame\bin with whatever directory you installed it in.)

After executing the above command, the new A-Shell Telnet Server service will appear in the Services Applet, where you can turn it on or off manually, as well as set it to start automatically on system bootup. In case of difficulty, see the Service Installation Tips in the following section.

The install script will offer to install the service for you, in which case it performs the atsdsrv –i command for you. But you still need to go into the Services Applet to launch it the first time, and to set it to launch automatically thereafter.

Note that you can use ATSDSRV.EXE to launch additional processes under the control of the one service, by adding additional parameter blocks to the ATSDSRV.INI named [Process1], [Process2], etc. Or, you can create copies of ATSDSRV.EXE and ATSDSRV.INI in other directories, with completely different service names. This might be an appropriate way of running background instances of A-Shell which act as "servers" in your application.

Subtopics