1.4 Ensure Service Runlevel Is Registered And Set Correctly

Information

Confirm, and set if necessary, the PostgreSQL runlevel on system-V operating systems.
Rationale:
Setting the runlevel on a System V OS ensures the database service is active especially 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.5 <-- registers if not already
$ chkconfig --level 3 postgresql-9.5 on
$ chkconfig --list | grep postgres
postgresql-9.5 0:off 1:off 2:off 3:on 4:off 5:off 6:off

See Also

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

Item Details

Category: SYSTEM AND SERVICES ACQUISITION

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

Plugin: Unix

Control ID: 0cc2d36903268721676607c7995395e748edd65f20fd175f365527eff959cdcc