Running Squore as a Windows Service

During the installation of Squore on Windows, the installer provides the option to register two services to control Squore's startup and shutdown. When you install the Windows services, you should no longer use the start and stop scripts described in the section called “Starting Squore on Windows”

Manual installation

If you did not select to register the services automatically at installation time, you can still register the PostgreSQL 8.4 Server and JBoss Application Server 7.1.1 services manually with the help of the instructions below.

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 <SQUORE_HOME>/config.xml. The instructions below use the default location (<SQUORE_DATA>\cluster).

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

    "<SQUORE_HOME>\server\bin\service.bat" install "JBAS71SVC"
    "<SQUORE_HOME>\tools\pgsql\bin\pg_ctl.exe" register -N "PG84SVC" -D "<SQUORE_DATA>\cluster"
    sc config "PG84SVC" DisplayName= "PostgreSQL 8.4 Server"
    sc config "JBAS71SVC" start= auto depend= "PG84SVC"
    

Services Configuration

After installing Squore Server and the Windows services, you should follow these steps on your server:

  1. Configure both services to run with a dedicated user instead of the built-in LocalSystem

  2. Ensure that the dedicated user you assigned to run the services is explicitly granted the Full Control permission on the following folders:

    • <SQUORE_HOME>

    • <SQUORE_DATA>\cluster

    • <SQUORE_DATA>\backup

    • <SQUORE_DATA>\projects

    • <SQUORE_DATA>\temp

    • <SQUORE_DATA>\temp\sources

    By explicitly granting this permission instead of inheriting it from a group, you ensure that you will not run into issues with folder and file permissions, especially if User Account Control is enabled on your server.

  3. Set the startup type for both services to Run automatically

Tip

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"

Uninstalling the Services

Tip

These instructions only apply to user who installed the windows services manually. If you used the Windows installer to install the services, they will be automatically removed when you uninstall Squore Server, .

Uninstalling the services can be done with these commands:

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