[Unit] Description=PostgreSQL chrooted database server After=network.target ConditionPathExists=/var/lib/pgsql/data/PG_VERSION ConditionPathIsDirectory=/var/lib/pgsql/data/base [Service] Type=forking PIDFile=/var/lib/pgsql/data/postmaster.pid SyslogIdentifier=postgres User=postgres Group=postgres Environment=PGDATA=/var/lib/pgsql/data EnvironmentFile=-/etc/sysconfig/postgresql OOMScoreAdjust=-200 ExecStartPre=/etc/chroot.d/postgresql.all ExecStart=/usr/bin/pg_ctl start -D "$PGDATA" -o "-C $PG_CHROOT_DIR" -s -w -t 300 ExecStop=/usr/bin/pg_ctl stop -D "$PGDATA" -s -m fast ExecReload=/usr/bin/pg_ctl reload -D "$PGDATA" -s # Give a reasonable amount of time for the server to start up/shut down TimeoutSec=300 [Install] WantedBy=multi-user.target