47 lines
1.3 KiB
Plaintext
47 lines
1.3 KiB
Plaintext
[Unit]
|
|
Description=PostgreSQL 13 database server
|
|
Documentation=https://www.postgresql.org/docs/13/static/
|
|
After=syslog.target
|
|
After=network.target
|
|
|
|
[Service]
|
|
Type=simple
|
|
|
|
User=root
|
|
Group=postgres
|
|
|
|
# Location of database directory
|
|
Environment=PGDATA=/var/lib/pgsql/13/data/
|
|
|
|
# This is normally controlled by the global default set by systemd
|
|
# StandardOutput=syslog
|
|
|
|
# Disable OOM kill on the postmaster
|
|
OOMScoreAdjust=-1000
|
|
Environment=PG_OOM_ADJUST_FILE=/proc/self/oom_score_adj
|
|
Environment=PG_OOM_ADJUST_VALUE=0
|
|
|
|
|
|
#reset
|
|
ExecStartPre=
|
|
#ours : we need root user as + and ! are not yet supported
|
|
ExecStartPre=-/sbin/e-smith/service-status postgresql-13
|
|
ExecStartPre=/sbin/e-smith/systemd/postgresql-initialize
|
|
ExecStartPre=/usr/pgsql-13/bin/postgresql-13-check-db-dir ${PGDATA}
|
|
ExecStartPre=-/sbin/e-smith/expand-template /var/lib/pgsql/13/data/postgresql.conf
|
|
ExecStartPre=-/sbin/e-smith/expand-template /var/lib/pgsql/13/data/pg_hba.conf
|
|
|
|
#reset
|
|
ExecStart=
|
|
#ours
|
|
ExecStart=/bin/su -s /bin/bash postgres -c "/usr/pgsql-13/bin/postmaster -D ${PGDATA}"
|
|
ExecReload=/bin/su -s /bin/bash postgres -c "/bin/kill -HUP $MAINPID"
|
|
KillMode=mixed
|
|
KillSignal=SIGINT
|
|
|
|
# Do not set any timeout value, so that systemd will not kill postmaster
|
|
TimeoutSec=0
|
|
|
|
[Install]
|
|
WantedBy=sme-server.target
|