Running Squore as a Service

During the installation of Squore on Windows, the installer provides the option to register two services to control Squore's startup and shutdown. If you did not select this option at installation time, you can still register the PostgreSQL 8.4 Server and JBoss Application Server 7.1.1 services manually following these instructions:

Tip

Before modifying your installation to use services, make sure that Squore Server starts up properly by following the steps described in the section called “Starting Squore on Windows”.

Follow the steps below to install the Squore services:

  1. Shutdown Squore Server

  2. Choose aliases for both services. The instructions below use the default aliases PG84SVC and JBAS71SVC.

  3. Find out what the location of the database cluster is from <INSTALLDIR>/config.xml. The instructions below use the default location (%SYSTEMDRIVE%\Squoring\squore-data\cluster).

  4. Install the services by running these commands in a command window as administrator:

    "<INSTALLDIR>\server\bin\service.bat" install "JBAS71SVC"
    "<INSTALLDIR>\tools\pgsql\bin\pg_ctl.exe" register -N "PG84SVC" -D "%SYSTEMDRIVE%\Squoring\squore-data\cluster"
    sc config "PG84SVC" DisplayName= "PostgreSQL 8.4 Server"
    sc config "JBAS71SVC" start= auto depend= "PG84SVC"
    

Note: After you configured Squore to run as a service, you no longer have to use the start and stop scripts in the bin folder. Instead, you can configure the services to start automatically when the server starts.

Tip

Uninstalling the services can be done with these commands:

"<INSTALLDIR>\server\bin\service.bat" uninstall "JBAS71SVC"
"<INSTALLDIR>\tools\pgsql\bin\pg_ctl.exe" unregister -N "PG84SVC"

You can manage and configure the two new services in the Windows Services console or from the command line. If you want to change their display names for example, you can use the following Windows command as administrator:

sc config "JBAS71SVC" DisplayName= "Squore Web"
sc config "PG84SVC" DisplayName= "Squore DB"