xref: /OK3568_Linux_fs/yocto/meta-openembedded/meta-oe/recipes-dbs/postgresql/files/postgresql.service (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun[Unit]
2*4882a593SmuzhiyunDescription=PostgreSQL database server
3*4882a593SmuzhiyunAfter=network.target
4*4882a593Smuzhiyun
5*4882a593Smuzhiyun[Service]
6*4882a593SmuzhiyunType=forking
7*4882a593SmuzhiyunUser=postgres
8*4882a593SmuzhiyunGroup=postgres
9*4882a593Smuzhiyun
10*4882a593Smuzhiyun# Port number for server to listen on
11*4882a593SmuzhiyunEnvironment=PGPORT=5432
12*4882a593Smuzhiyun
13*4882a593Smuzhiyun# Location of database directory
14*4882a593SmuzhiyunEnvironment=PGDATA=/var/lib/postgresql/data
15*4882a593Smuzhiyun
16*4882a593Smuzhiyun# Disable OOM kill on the postmaster
17*4882a593SmuzhiyunOOMScoreAdjust=-17
18*4882a593Smuzhiyun
19*4882a593SmuzhiyunExecStart=@BINDIR@/pg_ctl start -D ${PGDATA} -s -o "-p ${PGPORT}" -w -t 300
20*4882a593SmuzhiyunExecStop=@BINDIR@/pg_ctl stop -D ${PGDATA} -s -m fast
21*4882a593SmuzhiyunExecReload=@BINDIR@/pg_ctl reload -D ${PGDATA} -s
22*4882a593Smuzhiyun
23*4882a593Smuzhiyun# Give a reasonable amount of time for the server to start up/shut down
24*4882a593SmuzhiyunTimeoutSec=300
25*4882a593Smuzhiyun
26*4882a593Smuzhiyun[Install]
27*4882a593SmuzhiyunWantedBy=multi-user.target
28