diff options
author | Chong.Lu@windriver.com <Chong.Lu@windriver.com> | 2014-09-16 17:36:36 +0800 |
---|---|---|
committer | Martin Jansa <Martin.Jansa@gmail.com> | 2014-09-26 05:41:53 +0200 |
commit | 711f3b8da8547b510235bfddfc6d4880017b7a37 (patch) | |
tree | 0bd53851502ce8b8ec722d560ed6140328fcca5b /meta-oe/recipes-support/postgresql/files/postgresql.service | |
parent | dfa0b4c86d69c14a4fc8f3bda225526ead3bcd51 (diff) | |
download | meta-openembedded-711f3b8da8547b510235bfddfc6d4880017b7a37.tar.gz |
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 <Chong.Lu@windriver.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'meta-oe/recipes-support/postgresql/files/postgresql.service')
-rw-r--r-- | meta-oe/recipes-support/postgresql/files/postgresql.service | 27 |
1 files changed, 27 insertions, 0 deletions
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 @@ | |||
1 | [Unit] | ||
2 | Description=PostgreSQL database server | ||
3 | After=network.target | ||
4 | |||
5 | [Service] | ||
6 | Type=forking | ||
7 | User=postgres | ||
8 | Group=postgres | ||
9 | |||
10 | # Port number for server to listen on | ||
11 | Environment=PGPORT=5432 | ||
12 | |||
13 | # Location of database directory | ||
14 | Environment=PGDATA=/var/lib/postgresql/data | ||
15 | |||
16 | # Disable OOM kill on the postmaster | ||
17 | OOMScoreAdjust=-17 | ||
18 | |||
19 | ExecStart=@BINDIR@/pg_ctl start -D ${PGDATA} -s -o "-p ${PGPORT}" -w -t 300 | ||
20 | ExecStop=@BINDIR@/pg_ctl stop -D ${PGDATA} -s -m fast | ||
21 | ExecReload=@BINDIR@/pg_ctl reload -D ${PGDATA} -s | ||
22 | |||
23 | # Give a reasonable amount of time for the server to start up/shut down | ||
24 | TimeoutSec=300 | ||
25 | |||
26 | [Install] | ||
27 | WantedBy=multi-user.target | ||