[Unit] Description=PostgreSQL database server After=network.target [Service] Type=forking User=postgres Group=postgres # Port number for server to listen on Environment=PGPORT=5432 # Location of database directory Environment=PGDATA=/var/lib/postgresql/19.12 # Disable OOM kill on the postmaster OOMScoreAdjust=-17 PermissionsStartOnly=true ExecStart=/usr/bin/pg_ctl start -D ${PGDATA} -s -o "-p ${PGPORT}" -w -t 300 ExecStop=/usr/bin/pg_ctl stop -D ${PGDATA} -s -m fast ExecReload=/usr/bin/pg_ctl reload -D ${PGDATA} -s # Give a reasonable amount of time for the server to start up/shut down TimeoutSec=300 [Install] WantedBy=multi-user.target ""