You can use an application such as FireDaemon to configure RunUO or other Windows appliations to run as a service, which means it will continue running whether you are logged in or not and will start automatically when Windows starts. Services can also restart automatically, if they fail. FireDaemon costs $35.00. It can be downloaded and used for free for 30 days.
To run RunUO as a service with FireDaemon, download and install FireDaemon and then take the following steps.
Short Name: | Shard |
Display Name: | Shard |
Custom Prefix String: | |
Description: | RunUO Server |
Console Application | X |
Executable | E:\RunUO 1.0\Server.exe |
Working Directory: | E:\RunUO 1.0 |
Parameters | |
Start-up Time | 3000 |
The fields above have the following meanings.
Field | Purpose |
---|---|
Short Name | An abbreviated name for the service. This is the unique name by which the
service is known in Windows. This name defines the service registry key in
HKLM\System\CurrentControlSet\<Short Name>. This name can be used with
the command line net stop and net start commands.
So, if you want to start and stop the shard with net start shard
and net stop shard , put "shard" here. Or put "RunUO" if you would
prefer to use that name. Whitespace (i.e. spaces, tabs and punctuation) is not
permitted in this field. The name must begin with an alphabetic character (A-Z). |
Display Name | A more descriptive name for the service. This value will initially default
to the Short Name. The value is displayed in the Windows Services Applet, i.e.
this is what you would see if you opened the Windows Control Panel and then
went to "Services" or clicked on Start, selected Run, and typed
services.msc to see the installed services. If you picked "shard"
for the Short Name, this will field will default to "Shard" as well, but you
can change it to "RunUO" or whatever you prefer. This value may contain spaces.
|
Custom Prefix String | By default, when a service is installed the prefix "FireDaemon Service" is prepended to the Short Name. By checking this, the prefix can be modified or omitted entirely. |
Description | A description of the service. This value is displayed in the Windows Services Applet under Windows 2000, Windows XP or Windows 2003 only. It may remain blank or you can add a short description of the service, such as "RunUO Server". |
Field | Purpose |
---|---|
Console Application | Select this if a Win32 console application is being run as a service. Examples include Java, Perl and 3rd party Win32 applications. This toggle will cause different events to be sent to the application during shutdown; you can refer to the manual for further details. In this case, the RunUO server.exe application is a console application, so you can check this box, but it will still work without the box checked. |
Executable | This is the full path and name (including the file extension) of the executable to be run as the service, e.g. E:\RunUO 1.0\Server.exe |
Working Directory: | This is the working directory of the application to be run as a service.
This must be a valid mapped drive path or Universal/Uniform Naming Convention
(UNC) path to a network drive (e.g. \\c:\program files\runuo or whatever directory you used |
Parameters | This is an optional list of parameters that can be passed to the executable. It may contain user, system or service specific environment variables (eg. %MYVAR%). Since you don't need to pass any parameters to RunUO's server.exe program, you can leave this field blank. |
Start-up Time | This is the number of milliseconds that the service will take to start. This value is required so that FireDaemon can "checkpoint" the service startup process with the Windows Service Control Manager (SCM). If this amount of time elapses prior to the service entering a fully running state then the SCM will consider the service hung. Setting this value to a very low value is not recommended. I would recommend leaving this at the default value of 3000 milliseconds or even increasing that value. |
I would also recommend clicking on the Advanced tab and then putting
in a value for "Capture in File" under the "Output Capture" section. Otherwise,
if you have errors from modified scripts or new scripts you have added, you
won't see the error messages generated as server.exe starts. Pick a name
and location for a file to capture error messages. Then if you start RunUO with
net start shard
, but find you can't connect to the shard, you
can look at the error log and see any script errors that were generated.
If you want to see how FireDaemon's other settings are used, you can peruse the manual.
When you've fininshed configuring the service, click on Install. You should then see a message that the service has been successfully installed and a window should appear showing that the shard service is successfully running. You can close that window (FireDaemon will continue running in the background).
If you wish to verify that the shard software is running and listening for
connections, you can attempt logging in with your RunUO client software,
such as UOGateway, or you can go to a command line and verify that the
system is listening by using the command below assuming you are using
the default RunUO port of 2593 by using netstat -a | find "2593"
, which should produce output similar to the one below with the
system name of the PC your shard software is running on substituted for
"myshard".
netstat -a | find "2593"
TCP myshard:2593 myshard:0 LISTENING
UDP myshard:2593 *:*
You can start and stop the RunUO server.exe program from within FireDaemon by clicking on Service and then either Start or Stop.
Or you can now top and start the shard by issuing the following commands at a command line, presuming you used a "Short Name" of "shard" for the service:
net start shard
net stop shard
You can query the state of the shard by issuing an sc query
command at the command line, as shown below. If the shard is running, you
will see a state of "RUNNING", whereas it will be "STOPPED" if it is not
running.
sc query shard
SERVICE_NAME: shard
TYPE : 10 WIN32_OWN_PROCESS
STATE : 4 RUNNING
(STOPPABLE,NOT_PAUSABLE,ACCEPTS_SHUTDOWN)
WIN32_EXIT_CODE : 0 (0x0)
SERVICE_EXIT_CODE : 0 (0x0)
CHECKPOINT : 0x0
WAIT_HINT : 0x0