From 21a4ebcbc172c25008ab855c82d13ac918caa18a Mon Sep 17 00:00:00 2001 From: Li xin Date: Thu, 25 Jun 2015 11:23:38 +0800 Subject: opensaf: Fix warning and add systemd service files. 1) WARNING: The recipe opensaf is trying to install files into a shared area when those files already exist,so set --libdir=${libdir}/opensaf 2) Add systemd service file plmcboot.service and plmcd.service. Signed-off-by: Li Xin Signed-off-by: Joe MacDonald --- .../opensaf/opensaf/0001-plmcd-error-fix.patch | 43 ++++++++++++++++++++++ .../opensaf/opensaf/plmcboot.service | 13 +++++++ .../recipes-daemons/opensaf/opensaf/plmcd.service | 15 ++++++++ .../recipes-daemons/opensaf/opensaf_4.5.0.bb | 25 ++++++++++++- 4 files changed, 94 insertions(+), 2 deletions(-) create mode 100644 meta-networking/recipes-daemons/opensaf/opensaf/0001-plmcd-error-fix.patch create mode 100644 meta-networking/recipes-daemons/opensaf/opensaf/plmcboot.service create mode 100644 meta-networking/recipes-daemons/opensaf/opensaf/plmcd.service (limited to 'meta-networking') diff --git a/meta-networking/recipes-daemons/opensaf/opensaf/0001-plmcd-error-fix.patch b/meta-networking/recipes-daemons/opensaf/opensaf/0001-plmcd-error-fix.patch new file mode 100644 index 0000000000..624cd2d7b0 --- /dev/null +++ b/meta-networking/recipes-daemons/opensaf/opensaf/0001-plmcd-error-fix.patch @@ -0,0 +1,43 @@ +From f1813af4c154fb1d3950abbdf678c3a5a67222fc Mon Sep 17 00:00:00 2001 +From: Li xin +Date: Thu, 25 Jun 2015 11:44:27 +0900 +Subject: [PATCH] plmcd: error fix + +ld: cannot find -lsystemd-daemon +collect2: error: ld returned 1 exit status + +Signed-off-by: Li Xin +--- + contrib/plmc/plmcd/Makefile.am | 2 +- + contrib/plmc/plmcd/Makefile.in | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/contrib/plmc/plmcd/Makefile.am b/contrib/plmc/plmcd/Makefile.am +index 8d847f2..dd7913a 100644 +--- a/contrib/plmc/plmcd/Makefile.am ++++ b/contrib/plmc/plmcd/Makefile.am +@@ -32,7 +32,7 @@ plmcd_SOURCES = \ + plmcd_LDFLAGS = -lpthread + + if ENABLE_SYSTEMD +-plmcd_LDFLAGS += -lsystemd-daemon ++plmcd_LDFLAGS += -lsystemd + endif + + plmcd_LDADD = \ +diff --git a/contrib/plmc/plmcd/Makefile.in b/contrib/plmc/plmcd/Makefile.in +index 0185dc4..e40513a 100644 +--- a/contrib/plmc/plmcd/Makefile.in ++++ b/contrib/plmc/plmcd/Makefile.in +@@ -106,7 +106,7 @@ build_triplet = @build@ + host_triplet = @host@ + target_triplet = @target@ + sbin_PROGRAMS = plmcd$(EXEEXT) +-@ENABLE_SYSTEMD_TRUE@am__append_1 = -lsystemd-daemon ++@ENABLE_SYSTEMD_TRUE@am__append_1 = -lsystemd + subdir = plmcd + ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 + am__aclocal_m4_deps = $(top_srcdir)/configure.ac +-- +1.8.4.2 + diff --git a/meta-networking/recipes-daemons/opensaf/opensaf/plmcboot.service b/meta-networking/recipes-daemons/opensaf/opensaf/plmcboot.service new file mode 100644 index 0000000000..76ec73af9b --- /dev/null +++ b/meta-networking/recipes-daemons/opensaf/opensaf/plmcboot.service @@ -0,0 +1,13 @@ +[Unit] +Description=PLMCBOOT Program +After=network.target +ConditionPathExists=@SYSCONFDIR@/plmcd.conf + +[Service] +Type=oneshot +ExecStart=@SBINDIR@/plmcd -c @SYSCONFDIR@/plmcd.conf -s +ExecStop=@SBINDIR@/plmcd -c @SYSCONFDIR@/plmcd.conf -x +RemainAfterExit=yes + +[Install] +WantedBy=multi-user.target diff --git a/meta-networking/recipes-daemons/opensaf/opensaf/plmcd.service b/meta-networking/recipes-daemons/opensaf/opensaf/plmcd.service new file mode 100644 index 0000000000..1d48e7764c --- /dev/null +++ b/meta-networking/recipes-daemons/opensaf/opensaf/plmcd.service @@ -0,0 +1,15 @@ +[Unit] +Description=Plmcd Daemon +Requires=plmcboot.service +After=network.target plmcboot.service +ConditionPathExists=@SYSCONFDIR@/plmcd.conf + +[Service] +Type=forking +ExecStart=@SBINDIR@/plmcd -c @SYSCONFDIR@/plmcd.conf +ExecStartPost=/bin/touch /var/lock/subsys/plmcd +ExecStopPost=/bin/rm -rf /var/lock/subsys/plmcd +PIDFile=/var/run/plmcd.pid + +[Install] +WantedBy=multi-user.target diff --git a/meta-networking/recipes-daemons/opensaf/opensaf_4.5.0.bb b/meta-networking/recipes-daemons/opensaf/opensaf_4.5.0.bb index 5895b46072..3d0175e033 100644 --- a/meta-networking/recipes-daemons/opensaf/opensaf_4.5.0.bb +++ b/meta-networking/recipes-daemons/opensaf/opensaf_4.5.0.bb @@ -14,7 +14,11 @@ HOMEPAGE = "http://www.opensaf.org" inherit autotools useradd systemd pkgconfig SRC_URI = "${SOURCEFORGE_MIRROR}/${BPN}/releases/${BPN}-${PV}.tar.gz \ - file://install-samples-from-srcdir.patch" + file://install-samples-from-srcdir.patch \ + file://plmcd.service \ + file://plmcboot.service \ + file://0001-plmcd-error-fix.patch \ + " SRC_URI[md5sum] = "534c0a99438a62c4c8dda56cfa67300c" SRC_URI[sha256sum] = "2f5ba57fe67e94099c0df82d0a0dd207b5c583c93030035ba354c97b5471b590" @@ -29,11 +33,24 @@ USERADD_PACKAGES = "${PN}" GROUPADD_PARAM_${PN} = "-f -r opensaf" USERADD_PARAM_${PN} = "-r -g opensaf -d ${datadir}/opensaf/ -s ${sbindir}/nologin -c \"OpenSAF\" opensaf" -SYSTEMD_SERVICE_${PN} += "opensafd.service" +SYSTEMD_SERVICE_${PN} += "opensafd.service plmcboot.service plmcd.service" SYSTEMD_AUTO_ENABLE = "disable" +PACKAGECONFIG[systemd] = "--enable-systemd-daemon" + +do_configure_prepend () { + ( cd ${S}; autoreconf -f -i -s ) +} + +EXTRA_OECONF += " --libdir=${libdir}/opensaf " +EXTRA_OEMAKE += " -Wl,-rpath,${libdir}/opensaf " + +PKGLIBDIR="${libdir}/opensaf/opensaf" + FILES_${PN} += "${localstatedir}/run" +FILES_${PN}-staticdev += "${PKGLIBDIR}/*.a" + RDEPENDS_${PN} += "bash python" INSANE_SKIP_${PN} = "dev-so" @@ -45,4 +62,8 @@ do_install_append() { install -d ${D}${systemd_unitdir}/system install -m 0644 ${B}/osaf/services/infrastructure/nid/config/opensafd.service \ ${D}${systemd_unitdir}/system + install -m 644 ${WORKDIR}/plmc*.service ${D}/${systemd_unitdir}/system + sed -i -e 's#@SYSCONFDIR@#${sysconfdir}#g' ${D}${systemd_unitdir}/system/plmc*.service + sed -i -e 's#@SBINDIR@#${sbindir}#g' ${D}${systemd_unitdir}/system/plmc*.service + } -- cgit 1.2.3-korg