Hello community,

here is the log from the commit of package cluster-glue for openSUSE:Factory 
checked in at 2014-02-26 23:20:21
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/cluster-glue (Old)
 and      /work/SRC/openSUSE:Factory/.cluster-glue.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "cluster-glue"

Changes:
--------
--- /work/SRC/openSUSE:Factory/cluster-glue/cluster-glue.changes        
2013-12-11 16:42:13.000000000 +0100
+++ /work/SRC/openSUSE:Factory/.cluster-glue.new/cluster-glue.changes   
2014-02-26 23:20:25.000000000 +0100
@@ -1,0 +2,7 @@
+Sun Feb 23 23:33:52 UTC 2014 - [email protected]
+
+- logd: Add systemd unit file for logd (bnc#863248)
+
+- added patches:
+  * bnc863248-logd-add-systemd-support.patch
+-------------------------------------------------------------------

New:
----
  bnc863248-logd-add-systemd-support.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ cluster-glue.spec ++++++
--- /var/tmp/diff_new_pack.eMUeQj/_old  2014-02-26 23:20:26.000000000 +0100
+++ /var/tmp/diff_new_pack.eMUeQj/_new  2014-02-26 23:20:26.000000000 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package cluster-glue
 #
-# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -50,6 +50,7 @@
 Patch5:         ipmilan-ipmiif.patch
 Patch6:         
bnc851990_cluster-glue_external_vcenter_disable_hostname_verification.patch
 Patch7:         bnc854060_hb_report-add-xz-support.patch
+Patch8:         bnc863248-logd-add-systemd-support.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 BuildRequires:  OpenIPMI-devel
 BuildRequires:  asciidoc
@@ -75,6 +76,13 @@
 %else
 BuildRequires:  libnet
 %endif
+
+Requires(pre):  %fillup_prereq
+
+%if %{defined systemd_requires}
+BuildRequires:  systemd
+%{?systemd_requires}
+%endif
 Conflicts:      pacemaker < 1.1.8
 Conflicts:      heartbeat-common < 3.0.2
 Obsoletes:      heartbeat-common < 3.0.2
@@ -148,6 +156,7 @@
 %patch5 -p1
 %patch6 -p1
 %patch7 -p1
+%patch8 -p1
 ###########################################################
 
 %build
@@ -171,6 +180,9 @@
     --with-package-name=%{name} \
     --with-daemon-group=%{gname} \
     --with-daemon-user=%{uname} \
+%if %{defined _unitdir}
+    --with-systemdsystemunitdir=%{_unitdir} \
+%endif
     --docdir=%{glue_docdir}
 %endif
 make %{?_smp_mflags}
@@ -184,11 +196,10 @@
 find $RPM_BUILD_ROOT -name '*.la' -type f -print0 | xargs -0 rm -f
 find $RPM_BUILD_ROOT -name '*.pyc' -type f -print0 | xargs -0 rm -f
 find $RPM_BUILD_ROOT -name '*.pyo' -type f -print0 | xargs -0 rm -f
-test -d $RPM_BUILD_ROOT/sbin || mkdir $RPM_BUILD_ROOT/sbin
-(
-  cd $RPM_BUILD_ROOT/sbin
-  ln -s /etc/init.d/logd rclogd
-)
+%if %{defined _unitdir}
+ln -s /usr/sbin/service %{buildroot}%{_sbindir}/rclogd
+%endif
+
 ###########################################################
 
 %pre
@@ -209,15 +220,16 @@
         %{uname} 2>/dev/null || :
 fi
 
-%preun
-%stop_on_removal logd
-
+%if %{defined _unitdir}
 %post
-%{insserv_force_if_yast logd}
+%service_add_post logd.service
+
+%preun
+%service_del_preun logd.service
 
 %postun
-%restart_on_update logd
-%insserv_cleanup
+%service_del_postun logd.service
+%endif
 
 %post -n libglue2
 /sbin/ldconfig  
@@ -253,13 +265,18 @@
 %{_sbindir}/cibsecret
 %{_sbindir}/meatclient
 %{_sbindir}/stonith
-%{_sysconfdir}/init.d/logd
+
+%if %{defined _unitdir}
+%{_unitdir}/logd.service
+%endif
+
+#%{_sysconfdir}/init.d/logd
 %doc %{_mandir}/man1/*
 %doc %{_mandir}/man8/*
 %doc AUTHORS
 %doc COPYING
 %doc logd/logd.cf
-/sbin/rclogd
+%{_sbindir}/rclogd
 #%{_libdir}/heartbeat/lrmd
 %{_libdir}/heartbeat/ha_logd
 %{_libdir}/heartbeat/plugins/RAExec/*.so

++++++ bnc863248-logd-add-systemd-support.patch ++++++
>From e98f92959484dc913be739b78abaa549c9ea78d9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kristoffer=20Gr=C3=B6nlund?= <[email protected]>
Date: Mon, 24 Feb 2014 00:54:59 +0100
Subject: [PATCH] logd: Add systemd unit file for logd (bnc#863248)

Adds a systemd service script for logd, to replace the
old SysVInit script.
---
 Makefile.am          |  3 +++
 configure.ac         | 17 +++++++++++++++++
 logd/Makefile.am     |  6 +++++-
 logd/ha_logd.c       | 12 ++++++++----
 logd/logd.service.in | 13 +++++++++++++
 5 files changed, 46 insertions(+), 5 deletions(-)
 create mode 100644 logd/logd.service.in

diff --git a/Makefile.am b/Makefile.am
index d724837e2d1b..93dbaf6a0906 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -16,6 +16,9 @@
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 #
 
+DISTCHECK_CONFIGURE_FLAGS = \
+        --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir)
+
 MAINTAINERCLEANFILES   = Makefile.in aclocal.m4 configure DRF/config-h.in \
                          DRF/stamp-h.in libtool.m4 ltdl.m4 libltdl.tar
 
diff --git a/configure.ac b/configure.ac
index 2a93124ffd3b..b8a93a054ba0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -52,6 +52,22 @@ AC_ARG_WITH(pkg-name,
     [  --with-pkg-name=name     Override package name (if you're a packager 
needing to pretend) ],
     [ PACKAGE_NAME="$withval" ])
 
+PKG_PROG_PKG_CONFIG
+AC_ARG_WITH([systemdsystemunitdir],
+     [AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd 
service files])],,
+     [with_systemdsystemunitdir=auto])
+AS_IF([test "x$with_systemdsystemunitdir" = "xyes" -o 
"x$with_systemdsystemunitdir" = "xauto"], [
+     def_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir 
systemd)
+
+     AS_IF([test "x$def_systemdsystemunitdir" = "x"],
+         [AS_IF([test "x$with_systemdsystemunitdir" = "xyes"],
+                [AC_MSG_ERROR([systemd support requested but pkg-config unable 
to query systemd package])])
+          with_systemdsystemunitdir=no],
+         [with_systemdsystemunitdir="$def_systemdsystemunitdir"])])
+AS_IF([test "x$with_systemdsystemunitdir" != "xno"],
+      [AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])])
+AM_CONDITIONAL([HAVE_SYSTEMD], [test "x$with_systemdsystemunitdir" != "xno"])
+
 AM_INIT_AUTOMAKE($PACKAGE_NAME, $PACKAGE_VERSION)
 AC_DEFINE_UNQUOTED(GLUE_VERSION, "$PACKAGE_VERSION", Current version of the 
glue library)
 
@@ -1368,6 +1384,7 @@ lrm/Makefile                                              
        \
    lrm/test/testcases/Makefile                                 \
 logd/Makefile                                                  \
 logd/logd                                                      \
+logd/logd.service                                                      \
 replace/Makefile                                               \
 hb_report/Makefile                                             \
    hb_report/hb_report                                         \
diff --git a/logd/Makefile.am b/logd/Makefile.am
index 3005c7d1b375..7ac75e2814a3 100644
--- a/logd/Makefile.am
+++ b/logd/Makefile.am
@@ -48,5 +48,9 @@ ha_logger_LDADD   = $(top_builddir)/lib/clplumbing/libplumb.la
 logtest_SOURCES   = logtest.c
 logtest_LDADD     = $(top_builddir)/lib/clplumbing/libplumb.la
 
+if HAVE_SYSTEMD
+systemdsystemunit_DATA = \
+        logd.service
+else
 initd_SCRIPTS     = logd
-
+endif
diff --git a/logd/ha_logd.c b/logd/ha_logd.c
index 06cdd6eadfeb..c98b9d73acd7 100644
--- a/logd/ha_logd.c
+++ b/logd/ha_logd.c
@@ -637,7 +637,7 @@ parse_config(const char* cfgfile)
        gboolean        ret = TRUE;
 
        if ((f = fopen(cfgfile, "r")) == NULL){
-               cl_perror("Cannot open config file [%s]", cfgfile);
+               cl_log(LOG_WARNING, "Cannot open config file [%s]", cfgfile);
                return(FALSE);
        }
 
@@ -1016,9 +1016,13 @@ main(int argc, char** argv, char** envp)
        
        
        if (cfgfile && !parse_config(cfgfile)) {
-               cl_log(LOG_ERR, "Config file [%s] is incorrect."
-               ,       cfgfile);
-               exit(LSB_EXIT_NOTCONFIGED);
+               FILE* f;
+               if ((f = fopen(cfgfile, "r")) != NULL){
+                       fclose(f);
+                       cl_log(LOG_ERR, "Config file [%s] is incorrect."
+                              ,        cfgfile);
+                       exit(LSB_EXIT_NOTCONFIGED);
+               }
        }
        
        if (strlen(logd_config.debugfile) > 0) {
diff --git a/logd/logd.service.in b/logd/logd.service.in
new file mode 100644
index 000000000000..97835474af54
--- /dev/null
+++ b/logd/logd.service.in
@@ -0,0 +1,13 @@
+[Unit]
+Description=ha_logd logging daemon
+Before=pacemaker.service
+PartOf=pacemaker.service
+
+[Service]
+ExecStart=@libdir@/@HB_PKG@/ha_logd -c @sysconfdir@/logd.cf
+ExecStartPre=/bin/rm -f @HA_VARRUNDIR@/logd.pid
+ExecStopPost=/bin/rm -f @HA_VARRUNDIR@/logd.pid
+PIDFile=@HA_VARRUNDIR@/logd.pid
+
+[Install]
+WantedBy=multi-user.target
-- 
1.8.4.5

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to