initial commit of file from CVS for smeserver-postgresql on Sat Sep 7 20:54:55 AEST 2024
This commit is contained in:
20
root/usr/lib/systemd/system/pgsql.init.service
Normal file
20
root/usr/lib/systemd/system/pgsql.init.service
Normal file
@@ -0,0 +1,20 @@
|
||||
[Unit]
|
||||
SourcePath=/etc/rc.d/init.d/pgsql.init
|
||||
Description=Koozali SME Server pgsql DB injector for postgresql-13
|
||||
After=postgresql-13.service
|
||||
Requires=postgresql-13.service
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
Restart=no
|
||||
TimeoutSec=10min
|
||||
IgnoreSIGPIPE=no
|
||||
KillMode=process
|
||||
GuessMainPID=no
|
||||
RemainAfterExit=yes
|
||||
ExecStart=/etc/rc.d/init.d/pgsql.init start
|
||||
ExecStop=/etc/rc.d/init.d/pgsql.init stop
|
||||
|
||||
[Install]
|
||||
WantedBy=sme-server.target
|
||||
|
@@ -0,0 +1,46 @@
|
||||
[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
|
Reference in New Issue
Block a user