Starting and Stopping a Server Using systemd Service

Note
This section describes how to start the QHB service via the subsystem of systemd services initialization and management. Make sure it is installed on your Linux distribution.

When installing from the rpm package, it is possible to use the systemd service to automatically start the database server at system startup. For this you need to make sure you have a pre-installed service startup script. If you need to change the location of the database directory, specified by default, execute:

sudo systemctl edit qhb

Then, in the opened editor (the file is initially empty), specify the desired path:

[Service]
Environment=PGDATA=/opt/qhb/data

Save changes and exit the editor.

Rebuild the service and, if necessary, allow it to start during operating system reload:

sudo systemctl daemon-reload
sudo systemctl enable qhb

In the future, after the initial setup (see chapter Getting Started), you should start the service using the command:

sudo systemctl start qhb

And stop it using the command:

sudo systemctl stop qhb