1.4 Ensure Service Runlevel Is Registered And Set Correctly

Information

Confirm, and set if necessary, the PostgreSQL runlevel on SYSV operating systems.
Rationale:
Setting the runlevel on a SYSV OS ensures the database service is active when a change of state occurs as in the case of a system startup, reboot, or an explicit change of runlevel by the Sys Admin.

Solution

Irrespective of package source, PostgreSQL services can be identified because it typically includes the text string 'postgresql'. Correct installs automatically register the service although it may still be off. Multiple instances of PostgreSQL services often distinguish themselves using a version number. Unregistered services must be added before its runlevel can be administrated.
$ whoami
root
$ chkconfig --add postgresql-9.6 <-- registers if not already
$ chkconfig --level 3 postgresql-9.6 on
$ chkconfig --list | grep postgres
postgresql-9.6 0:off 1:off 2:off 3:on 4:off 5:off 6:off

See Also

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

Item Details

Category: SYSTEM AND SERVICES ACQUISITION

References: 800-53|SA-8, CSCv6|18, CSCv7|18

Plugin: Unix

Control ID: 1f10039f3a196e9d2cbff6e518b83aa8a8db64cfd3520a9f14db250aba3bdf40