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/postgresql.inc | |
| 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/postgresql.inc')
| -rw-r--r-- | meta-oe/recipes-support/postgresql/postgresql.inc | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/meta-oe/recipes-support/postgresql/postgresql.inc b/meta-oe/recipes-support/postgresql/postgresql.inc index 774c8fd0c9..d45f4b5edf 100644 --- a/meta-oe/recipes-support/postgresql/postgresql.inc +++ b/meta-oe/recipes-support/postgresql/postgresql.inc | |||
| @@ -30,6 +30,7 @@ SRC_URI = "http://ftp.postgresql.org/pub/source/v${PV}/${BP}.tar.bz2 \ | |||
| 30 | file://postgresql.pam \ | 30 | file://postgresql.pam \ |
| 31 | file://0001-Use-pkg-config-for-libxml2-detection.patch \ | 31 | file://0001-Use-pkg-config-for-libxml2-detection.patch \ |
| 32 | file://postgresql-setup \ | 32 | file://postgresql-setup \ |
| 33 | file://postgresql.service \ | ||
| 33 | " | 34 | " |
| 34 | 35 | ||
| 35 | LEAD_SONAME = "libpq.so" | 36 | LEAD_SONAME = "libpq.so" |
| @@ -37,7 +38,20 @@ LEAD_SONAME = "libpq.so" | |||
| 37 | # LDFLAGS for shared libraries | 38 | # LDFLAGS for shared libraries |
| 38 | export LDFLAGS_SL = "${LDFLAGS}" | 39 | export LDFLAGS_SL = "${LDFLAGS}" |
| 39 | 40 | ||
| 40 | inherit autotools pkgconfig perlnative pythonnative useradd update-rc.d | 41 | inherit autotools pkgconfig perlnative pythonnative useradd update-rc.d systemd |
| 42 | |||
| 43 | SYSTEMD_SERVICE_${PN} = "postgresql.service" | ||
| 44 | SYSTEMD_AUTO_ENABLE_${PN} = "disable" | ||
| 45 | |||
| 46 | DEPENDS_append = " ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'systemd-systemctl-native', '', d)}" | ||
| 47 | pkg_postinst_${PN} () { | ||
| 48 | if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd sysvinit', 'true', 'false', d)}; then | ||
| 49 | if [ -n "$D" ]; then | ||
| 50 | OPTS="--root=$D" | ||
| 51 | fi | ||
| 52 | systemctl $OPTS mask postgresql-server.service | ||
| 53 | fi | ||
| 54 | } | ||
| 41 | 55 | ||
| 42 | enable_pam = "${@base_contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}" | 56 | enable_pam = "${@base_contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}" |
| 43 | PACKAGECONFIG ??= "${enable_pam} openssl python uuid libxml tcl nls libxml perl" | 57 | PACKAGECONFIG ??= "${enable_pam} openssl python uuid libxml tcl nls libxml perl" |
| @@ -184,6 +198,12 @@ do_install_append() { | |||
| 184 | install -d ${D}${sysconfdir}/pam.d | 198 | install -d ${D}${sysconfdir}/pam.d |
| 185 | install -m 644 ${WORKDIR}/postgresql.pam ${D}${sysconfdir}/pam.d/postgresql | 199 | install -m 644 ${WORKDIR}/postgresql.pam ${D}${sysconfdir}/pam.d/postgresql |
| 186 | fi | 200 | fi |
| 201 | |||
| 202 | # Install systemd unit files | ||
| 203 | install -d ${D}${systemd_unitdir}/system | ||
| 204 | install -m 0644 ${WORKDIR}/postgresql.service ${D}${systemd_unitdir}/system | ||
| 205 | sed -i -e 's,@BINDIR@,${bindir},g' \ | ||
| 206 | ${D}${systemd_unitdir}/system/postgresql.service | ||
| 187 | } | 207 | } |
| 188 | 208 | ||
| 189 | SSTATE_SCAN_FILES += "Makefile.global" | 209 | SSTATE_SCAN_FILES += "Makefile.global" |
