Blame SOURCES/postgresql.service

7686b4
# It's not recommended to modify this file in-place, because it will be
7686b4
# overwritten during package upgrades.  If you want to customize, the
7686b4
# best way is to create a file "/etc/systemd/system/postgresql.service",
7686b4
# containing
7686b4
#	.include /lib/systemd/system/postgresql.service
7686b4
#	...make your changes here...
7686b4
# For more info about custom unit files, see
7686b4
# http://fedoraproject.org/wiki/Systemd#How_do_I_customize_a_unit_file.2F_add_a_custom_unit_file.3F
7686b4
7686b4
# For example, if you want to change the server's port number to 5433,
7686b4
# create a file named "/etc/systemd/system/postgresql.service" containing:
7686b4
#	.include /lib/systemd/system/postgresql.service
7686b4
#	[Service]
7686b4
#	Environment=PGPORT=5433
7686b4
# This will override the setting appearing below.
7686b4
7686b4
# Note: changing PGPORT or PGDATA will typically require adjusting SELinux
7686b4
# configuration as well; see /usr/share/doc/postgresql-*/README.rpm-dist.
7686b4
7686b4
# Note: do not use a PGDATA pathname containing spaces, or you will
7686b4
# break postgresql-setup.
7686b4
7686b4
# Note: in F-17 and beyond, /usr/lib/... is recommended in the .include line
7686b4
# though /lib/... will still work.
7686b4
7686b4
[Unit]
7686b4
Description=PostgreSQL database server
7686b4
After=network.target
7686b4
7686b4
[Service]
7686b4
Type=forking
7686b4
7686b4
User=postgres
7686b4
Group=postgres
7686b4
7686b4
# Port number for server to listen on
7686b4
Environment=PGPORT=5432
7686b4
7686b4
# Location of database directory
7686b4
Environment=PGDATA=/var/lib/pgsql/data
7686b4
7686b4
# Where to send early-startup messages from the server (before the logging
7686b4
# options of postgresql.conf take effect)
7686b4
# This is normally controlled by the global default set by systemd
7686b4
# StandardOutput=syslog
7686b4
7686b4
# Disable OOM kill on the postmaster
7686b4
OOMScoreAdjust=-1000
7686b4
7686b4
ExecStartPre=/usr/bin/postgresql-check-db-dir ${PGDATA}
7686b4
ExecStart=/usr/bin/pg_ctl start -D ${PGDATA} -s -o "-p ${PGPORT}" -w -t 300
7686b4
ExecStop=/usr/bin/pg_ctl stop -D ${PGDATA} -s -m fast
7686b4
ExecReload=/usr/bin/pg_ctl reload -D ${PGDATA} -s
7686b4
7686b4
# Give a reasonable amount of time for the server to start up/shut down
7686b4
TimeoutSec=300
7686b4
7686b4
[Install]
7686b4
WantedBy=multi-user.target