Book a Demo
Prev Next

Using Multiple Configurations

The Sparx Systems Pro Cloud Server can be run multiple times with different configurations by passing command line arguments.

The Pro Cloud Server executable can be run as either a standalone executable or a Windows service.  By default the Pro Cloud Server installer will create a Windows service that does not specify any arguments (which forces the Pro Cloud Server to uses the default settings).

Command line arguments

Argument

Description

-pp / --persistedpath

The argument following this will be interpreted as the root folder location of where Pro Cloud Server can store the files it needs to write during its execution, files such as the Pro Cloud Server's configuration, logging and temporary files.  For example:

C:\> SSProCloud.exe -pp C:\pcs\environment1\

This command line option is important when running Pro Cloud Server in a Docker environment.  Normally using the default configuration Pro Cloud Server requires read/write access to all of the files under its installation folder, and will write to the various files while it is running.  However in a Docker environment files that are updated in one session will not be persisted to the next, (as they are recreated/overwritten back to their initial states each session). Therefore all files that could be updated during execution and need to be retained for consecutive sessions need to be located on a different drive that will keep these changes persisted. 

Changing this parameter changes where the configuration files are read from, along with all paths in the configuration file that specify %SERVICE_PATH%. Setting this to a directory other than the default is an easy way to separate multiple running instances of the Cloud service.

Note: When multiple configurations are being used on a single machine, you must ensure that each instance accesses a unique persist path otherwise there will be problems reading the configuration database.

standalone

This argument allows starting the SSProCloud.exe as a standalone executable instead of requiring it to be launched as a Windows service.

This can be important if the Windows firewall is blocking the service, as it will prompt to create a firewall exception.

Additionally, Wine by default closes services automatically when the last user process closes, but using the 'standalone' argument to run the server as an application will ensure that the service isn't terminated when there are any clients connected. Use the command line:

     wine SSProCloud.exe standalone

Or, if you are launching from a terminal and want to close it:

     wine SSProCloud.exe standalone & disown     or

     nohup wine SSProCloud.exe standalone

(The 'disown' parameter and 'nohup' command both close the terminal but ignore the 'hangup' message that would otherwise disconnect Pro Cloud Server again.)

Additional Windows Services

It is possible to create additional Pro Cloud Server Windows services that run independently of one another and use different configurations.  Special care needs to be taken to ensure the correct syntax is specified when creating an additional Pro Cloud Server instance. 

For example to create a second Windows service that has a '2' appended to the default names/folders, perform these steps.

1.

Copy the entire contents of  'C:\Program Files\Sparx Systems\Pro Cloud Server\'  to a new folder of  'C:\Program Files\Sparx Systems\Pro Cloud Server2\'

2.

Edit the 'C:\Program Files\Sparx Systems\Pro Cloud Server2\SSProCloud.config' file and adjust the list of ports that this instance of the PCS should listen to.

3.

Open a terminal windows and enter this command:

C:\>  sc create "Sparx Systems Professional Cloud 2" binpath= "\"C:\Program Files\Sparx Systems\Pro Cloud Server2\Service\SSProCloud.exe\" -p \"C:\Program Files\Sparx Systems\Pro Cloud Server2\Service\" start= auto DisplayName= "Sparx Systems Professional Cloud 2"

This will define a new Windows service called  Sparx Systems Professional Cloud 2 and instruct it to use the 'C:\Program Files\Sparx Systems\Pro Cloud Server2\Service\' folder as the base location and use configuration files (SSProCloud.config & SSProCloud.db) located in there.

4.

To apply a description to the newly created Windows service, execute this command:

C:\>  sc description "Sparx Systems Professional Cloud 2" "Sparx Systems Professional Cloud 2"