1.4 Ensure systemd Service Files Are Enabled

Warning! Audit Deprecated

This audit has been deprecated and will be removed in a future update.

View Next Audit Version

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-12
Created symlink /etc/systemd/system/multi-user.target.wants/postgresql-12.service -> /usr/lib/systemd/system/postgresql-12.service.
# systemctl list-dependencies multi-user.target | grep -i postgres
- postgresql-12.service
#


References:

https://linuxcommand.org/man_pages/runlevel8.html

https://linuxcommand.org/man_pages/chkconfig8.html

https://www.tldp.org/LDP/sag/html/run-levels-intro.html

See Also

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