1.4 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.
[root@centos7 ~]# whoami
root
[root@centos7 ~]# systemctl enable postgresql-11
Created symlink from /etc/systemd/system/multi-user.target.wants/postgresql-11.service to /usr/lib/systemd/system/postgresql-11.service.
[root@centos7 ~]# systemctl list-dependencies multi-user.target | grep -i postgres
postgresql-11.service
[root@centos7 ~]#

See Also

https://workbench.cisecurity.org/files/2407

Item Details

Category: CONFIGURATION MANAGEMENT

References: 800-53|CM-6, CSCv6|18, CSCv7|5.1

Plugin: Unix

Control ID: cba35bbeee1eb4720bfde2a0594901a4c71408c84246ee9a72f18c5542101714