I am trying to install, configure, and start a postgresql 12
service on amazon linux 2023. I have installed the service from source and have created a postgresql.service
file in /usr/lib/systemd/system/
. I am not able to start the service (I placed the error below) and is there any other configuration that needs to be done? Thank you 🙂
contents of postgresql.service
systemd unit configuration
#
# This can be installed as a service on new system with
# systemctl enable "$PWD/postgresql.service"
#
# Check status with
# systemctl status postgresql
[Unit]
Description=PostgreSQL database server
After=remote-network.target
[Service]
Type=forking
User=root
Group=root
WorkingDirectory=/usr/lib/systemd/system
ExecStart="/usr/lib/systemd/system/postgresql.service"
TimeoutSec=300
[Install]
WantedBy=multi-user.target
ll /usr/lib/systemd/system/postgresql.service
-rw-r--r--. 1 root root 459 Oct 19 21:01 /usr/lib/systemd/system/postgresql.service
error:
Oct 19 21:01:53 ip-172-30-210-30 systemd[1]: Starting postgresql.service - PostgreSQL database server...
Oct 19 21:01:53 ip-172-30-210-30 systemd[336430]: postgresql.service: Failed to locate executable /usr/lib/systemd/system/postgresql.service: Permission denied
Oct 19 21:01:53 ip-172-30-210-30 systemd[336430]: postgresql.service: Failed at step EXEC spawning /usr/lib/systemd/system/postgresql.service: Permission denied
Oct 19 21:01:53 ip-172-30-210-30 systemd[1]: postgresql.service: Control process exited, code=exited, status=203/EXEC
Oct 19 21:01:53 ip-172-30-210-30 systemd[1]: postgresql.service: Failed with result 'exit-code'.
Oct 19 21:01:53 ip-172-30-210-30 systemd[1]: Failed to start postgresql.service - PostgreSQL database server.
Oct 19 21:02:13 ip-172-30-210-30 systemd[1]: /usr/lib/systemd/system/postgresql.service:1: Assignment outside of section. Ignoring.