From 711f3b8da8547b510235bfddfc6d4880017b7a37 Mon Sep 17 00:00:00 2001 From: "Chong.Lu@windriver.com" Date: Tue, 16 Sep 2014 17:36:36 +0800 Subject: postgresql: add systemd unit file Add systemd unit file for postgresql. When 'sysvinit' and 'systemd' are both in DISTRO_FEATURES, we need to prevent the init script from running via systemd. Signed-off-by: Chong Lu Signed-off-by: Martin Jansa --- .../postgresql/files/postgresql.service | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 meta-oe/recipes-support/postgresql/files/postgresql.service (limited to 'meta-oe/recipes-support/postgresql/files/postgresql.service') diff --git a/meta-oe/recipes-support/postgresql/files/postgresql.service b/meta-oe/recipes-support/postgresql/files/postgresql.service new file mode 100644 index 0000000000..4ec959e842 --- /dev/null +++ b/meta-oe/recipes-support/postgresql/files/postgresql.service @@ -0,0 +1,27 @@ +[Unit] +Description=PostgreSQL database server +After=network.target + +[Service] +Type=forking +User=postgres +Group=postgres + +# Port number for server to listen on +Environment=PGPORT=5432 + +# Location of database directory +Environment=PGDATA=/var/lib/postgresql/data + +# Disable OOM kill on the postmaster +OOMScoreAdjust=-17 + +ExecStart=@BINDIR@/pg_ctl start -D ${PGDATA} -s -o "-p ${PGPORT}" -w -t 300 +ExecStop=@BINDIR@/pg_ctl stop -D ${PGDATA} -s -m fast +ExecReload=@BINDIR@/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 -- cgit v1.2.3-54-g00ecf