Starting and stopping services v16

A service is a program that runs in the background and doesn't require user interaction. A service has no user interface. You can configure a service to start at boot time or manually on demand. Services are best controlled using the platform-specific operating system service control utility. Many of the EDB Postgres Advanced Server supporting components are services.

List of services

The following table lists the names of the services that control EDB Postgres Advanced Server and services that control EDB Postgres Advanced Server supporting components.

EDB Postgres Advanced Server component nameLinux service nameDebian service name
EDB Postgres Advanced Serveredb-as-16edb-as@16-main
pgAgentedb-pgagent-16edb-as16-pgagent
PgBounceredb-pgbouncer-1.21edb-pgbouncer121
pgPool-IIedb-pgpool-4.4edb-pgpool44
Slonyedb-slony-replication-15edb-as15-slony-replication
EFMedb-efm-4.0edb-efm-4.0

You can use the Linux command line to control the EDB Postgres Advanced Server database server and the services of EDB Postgres Advanced Server's supporting components. The commands that control the EDB Postgres Advanced Server service on a Linux platform are host specific.

Controlling a service on RHEL/CentOS 7.x or RHEL/Rocky Linux/AlmaLinux 8.x | 9.x

If your installation of EDB Postgres Advanced Server resides on version 7.x | 8.x | 9.x of RHEL and CentOS, you must use the systemctl command to control the EDB Postgres Advanced Server service and supporting components.

The systemctl command must be in your search path, and you must invoke it with superuser privileges. To use the command, at the command line, enter:

systemctl <action> <service_name>

Where:

service_name specifies the name of the service.

action specifies the action taken by the service command. Specify:

  • start to start the service.
  • stop to stop the service.
  • restart to stop and then start the service.
  • status to discover the current status of the service.

Controlling a service on Debian 10.x | 11.x or Ubuntu 20.04 | 22.04

If your installation of EDB Postgres Advanced Server resides on version 10.x | 11.x of Debian or 20.04 | 22.04 of Ubuntu, assume superuser privileges and invoke the following commands using bundled scripts to manage the service. Use the following commands to:

  • Discover the current status of a service:

    /usr/edb/as15/bin/epas_ctlcluster 15 main status
  • Stop a service:

    /usr/edb/as15/bin/epas_ctlcluster 15 main stop
  • Restart a service:

    /usr/edb/as15/bin/epas_ctlcluster 15 main restart
  • Reload a service:

    /usr/edb/as15/bin/epas_ctlcluster 15 main reload
  • Control the component services:

    systemctl restart edb-as@15-main

Using pg_ctl to control EDB Postgres Advanced Server

You can use the pg_ctl utility to control an EDB Postgres Advanced Server service from the command line on any platform. pg_ctl allows you to:

  • Start, stop, or restart the EDB Postgres Advanced Server database server
  • Reload the configuration parameters
  • Display the status of a running server

To invoke the utility, assume the identity of the cluster owner. In the home directory of EDB Postgres Advanced Server, enter:

./bin/pg_ctl -D <data_directory> <action>

data_directory is the location of the data controlled by the EDB Postgres Advanced Server cluster.

action specifies the action taken by the pg_ctl utility. Specify:

  • start to start the service.
  • stop to stop the service.
  • restart to stop and then start the service.
  • reload to send the server a SIGHUP signal, reloading configuration parameters.
  • status to discover the current status of the service.

For more information about using the pg_ctl utility or the command-line options available, see the PostgreSQL core documentation.

Choosing between pg_ctl and the service command

You can use the pg_ctl utility to manage the status of an EDB Postgres Advanced Server cluster. However, it's important to know that pg_ctl doesn't alert the operating system service controller to changes in the status of a server. We recommend using the service command when possible.

Configuring component services to autostart at system reboot

After installing, configuring, and starting the services of EDB Postgres Advanced Server supporting components on a Linux system, you must manually configure your system to autostart the service when your system restarts. To configure a service to autostart on a Linux system, at the command line, assume superuser privileges, and enter the command.

On a Redhat-compatible Linux system, enter:

/sbin/chkconfig <service_name> on

Where service_name specifies the name of the service.