Hello community,

here is the log from the commit of package cluster-glue for openSUSE:Factory 
checked in at 2014-10-11 22:41:48
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
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        
2014-07-27 08:25:37.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.cluster-glue.new/cluster-glue.changes   
2014-10-11 22:41:54.000000000 +0200
@@ -1,0 +2,6 @@
+Fri Oct 10 17:34:18 UTC 2014 - kgronl...@suse.com
+
+- high: hb_report: Collect logs from journald (boo#900654)
+- Add patch: 0001-high-hb_report-Collect-logs-from-journald-boo-900654.patch
+
+-------------------------------------------------------------------

New:
----
  0001-high-hb_report-Collect-logs-from-journald-boo-900654.patch

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

Other differences:
------------------
++++++ cluster-glue.spec ++++++
--- /var/tmp/diff_new_pack.QWNgqc/_old  2014-10-11 22:41:55.000000000 +0200
+++ /var/tmp/diff_new_pack.QWNgqc/_new  2014-10-11 22:41:55.000000000 +0200
@@ -50,6 +50,8 @@
 Patch2:         bnc662816_cluster-glue_hb_report_abspath.patch
 # PATCH-FIX-OPENSUSE: drop lrm as it's not used anymore by pacemaker
 Patch4:         cluster-glue_droplrm.patch
+# PATCH-FIX-OPENSUSE: high: hb_report: Collect logs from journald (boo#900654)
+Patch5:         0001-high-hb_report-Collect-logs-from-journald-boo-900654.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 BuildRequires:  OpenIPMI-devel
 BuildRequires:  asciidoc
@@ -156,6 +158,7 @@
 %patch1 -p1
 %patch2 -p1
 %patch4 -p1
+%patch5 -p1
 ###########################################################
 
 %build

++++++ 0001-high-hb_report-Collect-logs-from-journald-boo-900654.patch ++++++
>From 2405e74cc62a511ec2017372b6df23e22b8d27e8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kristoffer=20Gr=C3=B6nlund?= <k...@koru.se>
Date: Fri, 10 Oct 2014 17:46:10 +0200
Subject: [PATCH] high: hb_report: Collect logs from journald (boo#900654)

Uses journalctl to collect logs for the report period.
---
 hb_report/hb_report.in | 29 ++++++++++++++++++++++++++++-
 1 file changed, 28 insertions(+), 1 deletion(-)

diff --git a/hb_report/hb_report.in b/hb_report/hb_report.in
index 555fffa..167d075 100755
--- a/hb_report/hb_report.in
+++ b/hb_report/hb_report.in
@@ -305,11 +305,14 @@ logmark() {
 #
 findlog() {
        local logf=""
+       collect_journal $FROM_TIME $TO_TIME $WORKDIR/$JOURNAL_F
        if [ "$HA_LOGFACILITY" ]; then
                logf=`findmsg $UNIQUE_MSG | awk '{print $1}'`
        fi
        if [ -f "$logf" ]; then
                echo $logf
+       elif [ -f "$WORKDIR/$JOURNAL_F" ]; then
+               echo $WORKDIR/$JOURNAL_F
        else
                echo ${HA_DEBUGFILE:-$HA_LOGFILE}
                [ "${HA_DEBUGFILE:-$HA_LOGFILE}" ] &&
@@ -1094,6 +1097,29 @@ getlog() {
                fi
        fi
 }
+collect_journal() {
+       local from_time to_time outf
+       from_time="$1"
+       to_time="$2"
+       outf="$3"
+       if which journalctl > /dev/null 2>&1; then
+               if isnumber "$from_time" && [ $from_time -eq 0 ]; then
+                       from_time=$(date "+%Y-%m-%d %H:%M")
+               elif isnumber "$from_time"; then
+                       from_time=$(echo "$from_time" | awk '{ print 
strftime("%Y-%m-%d %H:%M", $1); }')
+               fi
+               if isnumber "$to_time" && [ $to_time -eq 0 ]; then
+                       to_time=$(date "+%Y-%m-%d %H:%M")
+               elif isnumber "$to_time"; then
+                       to_time=$(echo "$to_time" | awk '{ print 
strftime("%Y-%m-%d %H:%M", $1); }')
+               fi
+               if [ -f $outf ]; then
+                       warning "$outf already exists"
+               fi
+               debug "journalctl from: '$1' until: '$2' from_time '$from_time' 
to_time: '$to_time' > $outf"
+               journalctl --since "$from_time" --until "$to_time" --no-pager | 
tail -n +2 > $outf
+       fi
+}
 #
 # get all other info (config, stats, etc)
 #
@@ -1314,12 +1340,13 @@ fi
 ANALYSIS_F=analysis.txt
 DESCRIPTION_F=description.txt
 HALOG_F=ha-log.txt
+JOURNAL_F=journal.log
 BT_F=backtraces.txt
 SYSINFO_F=sysinfo.txt
 SYSSTATS_F=sysstats.txt
 DLM_DUMP_F=dlm_dump.txt
 TIME_F=time.txt
-export ANALYSIS_F DESCRIPTION_F HALOG_F BT_F SYSINFO_F SYSSTATS_F DLM_DUMP_F 
TIME_F
+export ANALYSIS_F DESCRIPTION_F HALOG_F JOURNAL_F BT_F SYSINFO_F SYSSTATS_F 
DLM_DUMP_F TIME_F
 CRM_MON_F=crm_mon.txt
 MEMBERSHIP_F=members.txt
 HB_UUID_F=hb_uuid.txt
-- 
1.8.4.5

-- 
To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org
For additional commands, e-mail: opensuse-commit+h...@opensuse.org

Reply via email to