[Unit]
Description=PostgreSQL 10 database server
After=syslog.target
After=network.target
[Service]
Type=forking
User=postgres
Group=postgres
Environment=PGDATA=/data01/pg10/
ExecStart=/data01/pg10/bin/pg_ctl start -D ${PGDATA} -l /tmp/logfile
ExecStop=/data01/pg10/bin/pg_ctl stop -D ${PGDATA} -l /tmp/logfile
ExecReload=/data01/pg10/bin/pg_ctl reload -D ${PGDATA}
ExecRestart=/data01/pg10/bin/pg_ctl restart -D ${PGDATA} -l /tmp/logfile
KillMode=mixed
TimeoutSec=0
[Install]
WantedBy=multi-user.target