1.2 Ensure systemd Service Files Are Enabled

Information

Confirm, and correct if necessary, the PostgreSQL systemd service is enabled.

Rationale:

Enabling the systemd service on the OS ensures the database service is active when a change of state occurs as in the case of a system startup or reboot.

Solution

Irrespective of package source, PostgreSQL services can be identified because it typically includes the text string 'postgresql'. PGDG installs do not automatically register the service as a 'want' of the default systemd target. Multiple instances of PostgreSQL services often distinguish themselves using a version number.

# whoami
root
# systemctl enable postgresql-14
Created symlink /etc/systemd/system/multi-user.target.wants/postgresql-14.service -> /usr/lib/systemd/system/postgresql-14.service.
# systemctl list-dependencies multi-user.target | grep -i postgres
postgresql-14.service

See Also

https://workbench.cisecurity.org/benchmarks/11866

Item Details

Category: CONFIGURATION MANAGEMENT, SYSTEM AND SERVICES ACQUISITION

References: 800-53|CM-1, 800-53|CM-2, 800-53|CM-6, 800-53|CM-7, 800-53|CM-7(1), 800-53|CM-9, 800-53|SA-3, 800-53|SA-8, 800-53|SA-10, CSCv7|5.1

Plugin: Unix

Control ID: eb85d15b1566f30ff636c12b653df093cc594e1cfbb720086bdd2dbe0302365a