Hello community,
here is the log from the commit of package health-checker for
openSUSE:Leap:15.2 checked in at 2020-03-09 17:59:35
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Leap:15.2/health-checker (Old)
and /work/SRC/openSUSE:Leap:15.2/.health-checker.new.26092 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "health-checker"
Mon Mar 9 17:59:35 2020 rev:13 rq:779526 version:1.3.1
Changes:
--------
--- /work/SRC/openSUSE:Leap:15.2/health-checker/health-checker.changes
2020-01-15 15:10:39.826081112 +0100
+++
/work/SRC/openSUSE:Leap:15.2/.health-checker.new.26092/health-checker.changes
2020-03-09 17:59:36.856646209 +0100
@@ -1,0 +2,57 @@
+Thu Jan 30 13:33:49 UTC 2020 - Ignaz Forster <[email protected]>
+
+- Update to version 1.3.1
+ * Support multiple menuentries in GRUB configuration
+ [gh#kubic-project/health-checker#5]
+
+-------------------------------------------------------------------
+Mon Dec 16 16:37:07 UTC 2019 - Ignaz Forster <[email protected]>
+
+- Update to version 1.3
+ * Support /var on non-root device for reading health data
+ * Avoid GRUB error message if env_block is not set [boo#1151072]
+ * Don't show message on manual emergency shell invocation
+ * Fix handling when booting a non-default snapshot
+
+-------------------------------------------------------------------
+Mon May 6 15:57:27 CEST 2019 - [email protected]
+
+- Update to version 1.2.3
+ * Fix crio RPM name
+
+-------------------------------------------------------------------
+Wed Mar 20 13:17:09 CET 2019 - [email protected]
+
+- Update to version 1.2.2
+ * Fix product namings
+
+-------------------------------------------------------------------
+Thu Mar 14 09:03:32 CET 2019 - [email protected]
+
+- Update to version 1.2.1
+ * Make sure telmetrics payload is not empty in success case
+
+-------------------------------------------------------------------
+Wed Feb 27 15:20:11 CET 2019 - [email protected]
+
+- Update to version 1.2
+ * Add hooks to send telemetrics events
+
+-------------------------------------------------------------------
+Mon Feb 4 10:57:58 CET 2019 - [email protected]
+
+- Update to version 1.1
+ * new plugins for crio and kubelet
+- Add new sub-package with test cases for openSUSE Kubic
+
+-------------------------------------------------------------------
+Wed Dec 19 14:15:00 CET 2018 - [email protected]
+
+- Split the CaaSP plugin into a MicroOS and CaaSP part
+
+-------------------------------------------------------------------
+Wed Aug 8 17:07:38 UTC 2018 - [email protected]
+
+- Use noun phrase in summary.
+
+-------------------------------------------------------------------
Old:
----
health-checker-1.0.tar.xz
New:
----
health-checker-1.3.1.tar.xz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ health-checker.spec ++++++
--- /var/tmp/diff_new_pack.vF1XMh/_old 2020-03-09 17:59:37.440646499 +0100
+++ /var/tmp/diff_new_pack.vF1XMh/_new 2020-03-09 17:59:37.444646502 +0100
@@ -1,7 +1,7 @@
#
# spec file for package health-checker
#
-# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2020 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -12,14 +12,14 @@
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
-# Please submit bugfixes or comments via http://bugs.opensuse.org/
+# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
Name: health-checker
-Version: 1.0
+Version: 1.3.1
Release: 0
-Summary: Verify that all important services are running
+Summary: Service for verifying that important services are running
License: GPL-2.0-only
Group: System/Base
URL: https://github.com/kubic-project/health-checker
@@ -28,7 +28,6 @@
BuildRequires: suse-module-tools
Requires: health-checker-plugins = 1.0
BuildArch: noarch
-%{?systemd_requires}
%description
health-checker is a service running once at every reboot to verify
@@ -39,6 +38,26 @@
This package does not contain any checks. For this, additional
plugins for different products are needed.
+%package plugins-MicroOS
+Summary: Health-checker plugins for openSUSE MicroOS
+Group: System/Base
+Requires: %{name} >= %{version}
+Provides: health-checker-plugins = 1.0
+
+%description plugins-MicroOS
+This package contains health-checker plugins for testing that
+the openSUSE MicroOS did boot correctly.
+
+%package plugins-kubic
+Summary: Health-checker plugins for openSUSE Kubic
+Group: System/Base
+Requires: %{name} >= %{version}
+Provides: health-checker-plugins = 1.0
+
+%description plugins-kubic
+This package contains health-checker plugins for testing that
+the openSUSE Kubic did boot correctly.
+
%package plugins-caasp
Summary: Health-checker plugins for SUSE CaaS Platform
Group: System/Base
@@ -104,11 +123,17 @@
%dir %{_libexecdir}/dracut/modules.d
%{_libexecdir}/dracut/modules.d/50health-checker
-%files plugins-caasp
-%{_libexecdir}/health-checker/etcd.sh
+%files plugins-MicroOS
+%{_libexecdir}/health-checker/crio.sh
%{_libexecdir}/health-checker/etc-overlayfs.sh
%{_libexecdir}/health-checker/rebootmgr.sh
+%files plugins-caasp
+%{_libexecdir}/health-checker/etcd.sh
+
+%files plugins-kubic
+%{_libexecdir}/health-checker/kubelet.sh
+
%files testing
%{_libexecdir}/health-checker/health-check-tester.sh
++++++ health-checker-1.0.tar.xz -> health-checker-1.3.1.tar.xz ++++++
++++ 2490 lines of diff (skipped)
++++ retrying with extended exclude list
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh
old/health-checker-1.0/NEWS new/health-checker-1.3.1/NEWS
--- old/health-checker-1.0/NEWS 2018-05-23 12:44:04.000000000 +0200
+++ new/health-checker-1.3.1/NEWS 2020-01-30 14:22:46.000000000 +0100
@@ -1,6 +1,31 @@
issue-generator NEWS -- history of user-visible changes.
-Copyright (C) 2017-2018 Thorsten Kukuk
+Copyright (C) 2017-2020 Thorsten Kukuk et al.
+
+Version 1.3.1
+* Support multiple menuentries in GRUB configuration
+ [gh#kubic-project/health-checker#5]
+
+Version 1.3
+* Support /var on non-root device for reading health data
+* Avoid GRUB error message if env_block is not set [boo#1151072]
+* Don't show message on manual emergency shell invocation
+* Fix handling when booting a non-default snapshot
+
+Version 1.2.3
+* Fix name of crio RPM
+
+Version 1.2.2
+* Fix naming in systemd units
+
+Version 1.2.1
+* Fix telemetrics payload in success case
+
+Version 1.2
+* Add hooks for telemetrics events
+
+Version 1.1
+* Add checks for kubelet and crio
Version 1.0
* Skip health checker if emergency shell started by user
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh
old/health-checker-1.0/README.md new/health-checker-1.3.1/README.md
--- old/health-checker-1.0/README.md 2017-03-24 15:13:41.000000000 +0100
+++ new/health-checker-1.3.1/README.md 2019-03-29 00:01:36.000000000 +0100
@@ -1,6 +1,6 @@
# health-checker
-Check the state of a SUSE CaaSP system after a reboot.
+Check the state of a openSUSE MicroOS system after a reboot.
## How does this work?
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh
old/health-checker-1.0/configure.ac new/health-checker-1.3.1/configure.ac
--- old/health-checker-1.0/configure.ac 2018-05-23 12:44:13.000000000 +0200
+++ new/health-checker-1.3.1/configure.ac 2020-01-30 14:23:47.000000000
+0100
@@ -1,5 +1,5 @@
dnl Process this file with autoconf to produce a configure script.
-AC_INIT(health-checker, 1.0)
+AC_INIT(health-checker, 1.3.1)
AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR([sbin/health-checker.in])
AC_PREFIX_DEFAULT(/usr)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh
old/health-checker-1.0/dracut/health-checker-emergency.sh
new/health-checker-1.3.1/dracut/health-checker-emergency.sh
--- old/health-checker-1.0/dracut/health-checker-emergency.sh 2018-05-23
12:30:37.000000000 +0200
+++ new/health-checker-1.3.1/dracut/health-checker-emergency.sh 2020-01-29
15:37:39.000000000 +0100
@@ -9,14 +9,23 @@
# - if reboot does not help, log this
#
-STATE_FILE=/var/lib/misc/health-check.state
-REBOOTED_STATE=/var/lib/misc/health-check.rebooted
+HC_ROOT_MOUNT="/run/health-checker"
+STATE_FILE="${HC_ROOT_MOUNT}/var/lib/misc/health-check.state"
+REBOOTED_STATE="${HC_ROOT_MOUNT}/var/lib/misc/health-check.rebooted"
BTRFS_ID=0
set_btrfs_id()
{
- BTRFS_ID=`btrfs subvolume get-default ${NEWROOT} | awk '{print $2}'`
+ BTRFS_ID=`btrfs subvolume get-default "${HC_ROOT_MOUNT}" | awk '{print
$2}'`
+}
+
+umount_and_reboot()
+{
+ if findmnt "${HC_ROOT_MOUNT}" > /dev/null; then
+ umount --recursive "${HC_ROOT_MOUNT}"
+ fi
+ systemctl reboot --force
}
clear_and_reboot()
@@ -33,14 +42,13 @@
try_grub_recovery()
{
warn "Trying recovery via GRUB2 snapshot mechanism."
- systemctl reboot --force
+ umount_and_reboot
}
rollback()
{
. ${STATE_FILE}
- mount -o remount,rw ${NEWROOT}
- btrfs subvolume set-default ${LAST_WORKING_BTRFS_ID} ${NEWROOT}
+ btrfs subvolume set-default ${LAST_WORKING_BTRFS_ID} "${HC_ROOT_MOUNT}"
if [ $? -ne 0 ]; then
warn "ERROR: btrfs set-default $BTRFS_ID failed!"
return 1
@@ -81,8 +89,8 @@
# Make sure we know root device
[ -z "$root" ] && root=$(getarg root=)
-if getargbool 1 rd.shell -d -y rdshell || getarg rd.break -d rdbreak; then
- info "health checker: manual invocation of emergency shell, doing nothing"
+if getargbool 0 rd.break; then
+ true # manual invocation of emergency shell, doing nothing
elif [ -n "$root" -a -z "${root%%block:*}" ]; then
info "root device: ${root}"
@@ -96,18 +104,22 @@
info "my_root device exist"
# Try to mount health-checker data
- mkdir -p /run/health-checker
- mkdir -p /var/lib
- if mount -t btrfs -o subvol=@/var/lib/misc "${my_root}" /run/health-checker;
then
- ln -s /run/health-checker -t /var/lib/misc
- elif mount -t btrfs -o subvol=@/var "${my_root}" /run/health-checker; then
- ln -s /run/health-checker/var/lib/misc -t /var/lib/misc
+ mkdir -p "${HC_ROOT_MOUNT}"
+ if mount "${my_root}" "${HC_ROOT_MOUNT}"; then
+ info "my_root mounted successfully"
+ state_dev_cands=("/var/lib/misc" "/var")
+ for cand in "${state_dev_cands[@]}"; do
+ findmnt --first-only --direction backward --noheadings --tab-file
"${HC_ROOT_MOUNT}/etc/fstab" "${cand}" | while read _m _d _t _o; do
+ mkdir -p "${HC_ROOT_MOUNT}/${cand}"
+ mount -t ${_t} -o ${_o} ${_d} "${HC_ROOT_MOUNT}/${cand}"
+ done
+ done
fi
# Try to recover somehow
- if [ -e /var/lib/misc ]; then
+ if [ -e "${HC_ROOT_MOUNT}/var/lib/misc" ]; then
error_decission
- umount /run/health-checker ||:
+ umount --recursive "${HC_ROOT_MOUNT}" ||:
else
warn "Mounting health-checker data failed."
try_grub_recovery
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh
old/health-checker-1.0/grub/05_health_check
new/health-checker-1.3.1/grub/05_health_check
--- old/health-checker-1.0/grub/05_health_check 2018-05-23 12:30:37.000000000
+0200
+++ new/health-checker-1.3.1/grub/05_health_check 2020-01-29
15:37:39.000000000 +0100
@@ -11,7 +11,9 @@
# This prevents getting stuck in a loop when booting an entry that
# doesn't support this flag yet.
health_checker_flag=0
- save_env -f "\${env_block}" health_checker_flag
+ if [ "\${env_block}" ] ; then
+ save_env -f "\${env_block}" health_checker_flag
+ fi
# Try to mount /var/lib/misc from know subvolume locations
btrfs-mount-subvol (\${root}) /var /@/var
btrfs-mount-subvol (\${root}) /var/lib/misc /@/var/lib/misc
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh
old/health-checker-1.0/grub/83_health_check_marker
new/health-checker-1.3.1/grub/83_health_check_marker
--- old/health-checker-1.0/grub/83_health_check_marker 2018-05-23
12:30:37.000000000 +0200
+++ new/health-checker-1.3.1/grub/83_health_check_marker 2020-01-30
14:15:21.000000000 +0100
@@ -2,7 +2,7 @@
set -e
# GRUB's grub2_mkconfig script currently has some serious limitations, one of
-# them beeing not providing a way to modify anything done by previous scripts;
+# them being not providing a way to modify anything done by previous scripts;
# unfortunately health_checker requires additional commands to be executed
# when selecting a boot entry (which is usually created by 10_linux), so as a
# horrible workaround the temporary output will be modified by a sed script.
@@ -13,16 +13,19 @@
cfgfile="`readlink /proc/$$/fd/1`"
if [ -f "$cfgfile" ]; then
- lines_to_add='\n\thealth_checker_flag=1\n\tsave_env -f "${env_block}"
health_checker_flag'
+ lines_to_add='\n'
+ lines_to_add+='\thealth_checker_flag=1\n'
+ lines_to_add+='\tif [ "${env_block}" ] ; then\n'
+ lines_to_add+='\t\tsave_env -f "${env_block}" health_checker_flag\n'
+ lines_to_add+='\tfi'
- # The sed expression below will inject contents into the opened file; the
- # original process will not notice that and will continue writing from the
- # last position. To set the pointer to the correct posision add the number
- # of characters which will be injected to the file (they won't appear in
- # the final output).
- echo -n -e $lines_to_add
+ # The cp expression below will copy the new contents into the opened file;
+ # the original process would not notice that and will continue writing from
+ # the last position. To avoid that add the append flag to stdout to make sure
+ # every write operation appends to the file.
+ dd oflag=append count=0 status=none
- sed 's/^\(menuentry .*\)/\1\n\thealth_checker_flag=1\n\tsave_env -f
"${env_block}" health_checker_flag/' "$cfgfile" > "$cfgfile".health_checker
+ sed 's/^\(menuentry .*\)/\1'"${lines_to_add}"'/' "$cfgfile" >
"$cfgfile".health_checker
cp "$cfgfile".health_checker "$cfgfile"
rm "$cfgfile".health_checker
fi
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh
old/health-checker-1.0/man/health-checker.8
new/health-checker-1.3.1/man/health-checker.8
--- old/health-checker-1.0/man/health-checker.8 2017-05-16 16:07:28.000000000
+0200
+++ new/health-checker-1.3.1/man/health-checker.8 2019-12-05
17:52:48.000000000 +0100
@@ -1,13 +1,13 @@
'\" t
.\" Title: health-checker
.\" Author: Thorsten Kukuk <[email protected]>
-.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\" Date: 05/16/2017
+.\" Generator: DocBook XSL Stylesheets vsnapshot <http://docbook.sf.net/>
+.\" Date: 12/05/2019
.\" Manual: health-checker
.\" Source: health-checker
.\" Language: English
.\"
-.TH "HEALTH\-CHECKER" "8" "05/16/2017" "health-checker" "health-checker"
+.TH "HEALTH\-CHECKER" "8" "12/05/2019" "health-checker" "health-checker"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
@@ -51,6 +51,12 @@
\fBstop\fR\&. If called with "check", the plugin should verify that the
service works and return 0, else 1\&. If one plugin returns "1",
\fBhealth\-check\fR
will evaluate what to do\&. If neither a rollback or reboot is usefull, all
plugins will be called with the "stop" option\&. In this case, the plugins
should shutdown the services are far as possible and usefull\&.
+.SH "TELEMETRY"
+.PP
+If
+\fBtelem-record-gen\fR(1)
+is installed telemetry events are created additional to logging with
+\fBsyslog\fR(3)\&.
.SH "SEE ALSO"
.PP
\fBtransactional-update\fR(8)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh
old/health-checker-1.0/man/health-checker.8.html
new/health-checker-1.3.1/man/health-checker.8.html
--- old/health-checker-1.0/man/health-checker.8.html 2017-05-16
16:07:28.000000000 +0200
+++ new/health-checker-1.3.1/man/health-checker.8.html 2019-12-05
17:52:48.000000000 +0100
@@ -1,4 +1,4 @@
-<html><head><meta http-equiv="Content-Type" content="text/html;
charset=UTF-8"><title>health-checker</title><meta name="generator"
content="DocBook XSL Stylesheets V1.78.1"></head><body bgcolor="white"
text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><style>
+<html><head><meta http-equiv="Content-Type" content="text/html;
charset=UTF-8"><title>health-checker</title><meta name="generator"
content="DocBook XSL Stylesheets Vsnapshot"></head><body bgcolor="white"
text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><style>
a.headerlink {
color: #c60f0f;
font-size: 0.8em;
@@ -15,25 +15,29 @@
h1:hover > a.headerlink, h2:hover > a.headerlink, h3:hover > a.headerlink,
dt:hover > a.headerlink {
visibility: visible;
}
- </style><a href="health-checker.index.html">Index </a><span
style="float:right">health-checker 0.3</span><hr><div class="refentry"><a
name="health-checker.8"></a><div class="titlepage"></div><div
class="refnamediv"><a name="name"></a><h2>Name</h2><p>health-checker,
health-checker.service — Checks that all important services of a system did
come up
+ </style><a href="health-checker.index.html">Index </a><span
style="float:right">health-checker 1.2.3</span><hr><div class="refentry"><a
name="health-checker.8"></a><div class="titlepage"></div><div
class="refnamediv"><a name="name"></a><h2>Name</h2><p>health-checker,
health-checker.service — Checks that all important services of a system did
come up
correctly after an update and reboot.</p></div><div
class="refsynopsisdiv"><a name="synopsis"></a><h2>Synopsis</h2><div
class="cmdsynopsis"><p><code class="command">/usr/sbin/health-checker</code>
</p></div><div class="cmdsynopsis"><p><code
class="command">/usr/sbin/health-checker</code> --version </p></div><p><code
class="filename">health-checker.service</code></p></div><div
class="refsect1"><a name="description"></a><h2 id="DESCRIPTION">DESCRIPTION<a
class="headerlink" title="Permalink to this headline"
href="#DESCRIPTION">¶</a></h2><p><span
class="emphasis"><em>health-checker</em></span>
-checks during boot, if the system is coming up correct.
-In error case, the action depends on what did happen before. If this is the
-first boot after a transactional update, an automatic rollback to the last
-known working snapshot is made. If the snapshot was already rebooted
-successfull before, a reboot is tried. If this does not help, some sevices are
-shutdown and an admin has to repair the system.
-</p><p>
-If the boot was successfull, the current snapshot is marked as known to be
-working.
-</p><p>Plugins are used for performing the tests and new plugins can be
-written. They are stored in the
-<code class="filename">/usr/lib/health-checker</code> directory and executed
either
-with the option <span class="command"><strong>check</strong></span> or <span
class="command"><strong>stop</strong></span>.
-If called with "check", the plugin should verify that the service works and
-return 0, else 1. If one plugin returns "1", <span
class="command"><strong>health-check</strong></span>
-will evaluate what to do. If neither a rollback or reboot is usefull, all
-plugins will be called with the "stop" option. In this case, the plugins
+ checks during boot, if the system is coming up correct.
+ In error case, the action depends on what did happen before. If this is the
+ first boot after a transactional update, an automatic rollback to the last
+ known working snapshot is made. If the snapshot was already rebooted
+ successfull before, a reboot is tried. If this does not help, some sevices
+ are shutdown and an admin has to repair the system.
+ </p><p>
+ If the boot was successfull, the current snapshot is marked as known to be
+ working.
+ </p><p>Plugins are used for performing the tests and new plugins can be
+ written. They are stored in the
+ <code class="filename">/usr/lib/health-checker</code> directory and executed
either
+ with the option <span class="command"><strong>check</strong></span> or <span
class="command"><strong>stop</strong></span>.
+ If called with "check", the plugin should verify that the service works and
+ return 0, else 1. If one plugin returns "1", <span
class="command"><strong>health-check</strong></span>
+ will evaluate what to do. If neither a rollback or reboot is usefull, all
+ plugins will be called with the "stop" option. In this case, the plugins
should shutdown the services are far as possible and usefull.
-</p></div><div class="refsect1"><a name="see_also"></a><h2 id="SEE ALSO">SEE
ALSO<a class="headerlink" title="Permalink to this headline"
href="#SEE%20ALSO">¶</a></h2><p><a href="transactional-update.8.html"><span
class="citerefentry"><span
class="refentrytitle">transactional-update</span>(8)</span></a>
-</p></div></div></body></html>
+ </p></div><div class="refsect1"><a name="telemetry"></a><h2
id="TELEMETRY">TELEMETRY<a class="headerlink" title="Permalink to this
headline" href="#TELEMETRY">¶</a></h2><p>
+ If <a href="telem-record-gen.1.html"><span class="citerefentry"><span
class="refentrytitle">telem-record-gen</span>(1)</span></a>
+ is installed telemetry events are created additional to logging with
+ <a href="syslog.3.html"><span class="citerefentry"><span
class="refentrytitle">syslog</span>(3)</span></a>.
+ </p></div><div class="refsect1"><a name="see_also"></a><h2 id="SEE ALSO">SEE
ALSO<a class="headerlink" title="Permalink to this headline"
href="#SEE%20ALSO">¶</a></h2><p><a href="transactional-update.8.html"><span
class="citerefentry"><span
class="refentrytitle">transactional-update</span>(8)</span></a>
+ </p></div></div></body></html>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh
old/health-checker-1.0/man/health-checker.8.xml
new/health-checker-1.3.1/man/health-checker.8.xml
--- old/health-checker-1.0/man/health-checker.8.xml 2017-05-16
16:07:25.000000000 +0200
+++ new/health-checker-1.3.1/man/health-checker.8.xml 2019-03-29
00:01:36.000000000 +0100
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
- "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
+"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd">
<!-- \-*\- nroff \-*\- -->
-<!-- Copyright 2017 Thorsten Kukuk <[email protected]> -->
+<!-- Copyright 2017, 2019 Thorsten Kukuk <[email protected]> -->
<!-- This program is free software; you can redistribute it and/or -->
<!-- modify it under the terms of the GNU General Public License as -->
@@ -59,35 +59,42 @@
</refsynopsisdiv>
-<refsect1 id='description'><title>DESCRIPTION</title>
-<para><emphasis remap='B'>health-checker</emphasis>
-checks during boot, if the system is coming up correct.
-In error case, the action depends on what did happen before. If this is the
-first boot after a transactional update, an automatic rollback to the last
-known working snapshot is made. If the snapshot was already rebooted
-successfull before, a reboot is tried. If this does not help, some sevices are
-shutdown and an admin has to repair the system.
-</para>
-<para>
-If the boot was successfull, the current snapshot is marked as known to be
-working.
-</para>
-<para>Plugins are used for performing the tests and new plugins can be
-written. They are stored in the
-<filename>/usr/lib/health-checker</filename> directory and executed either
-with the option <command>check</command> or <command>stop</command>.
-If called with "check", the plugin should verify that the service works and
-return 0, else 1. If one plugin returns "1", <command>health-check</command>
-will evaluate what to do. If neither a rollback or reboot is usefull, all
-plugins will be called with the "stop" option. In this case, the plugins
+ <refsect1 id='description'><title>DESCRIPTION</title>
+ <para><emphasis remap='B'>health-checker</emphasis>
+ checks during boot, if the system is coming up correct.
+ In error case, the action depends on what did happen before. If this is the
+ first boot after a transactional update, an automatic rollback to the last
+ known working snapshot is made. If the snapshot was already rebooted
+ successfull before, a reboot is tried. If this does not help, some sevices
+ are shutdown and an admin has to repair the system.
+ </para>
+ <para>
+ If the boot was successfull, the current snapshot is marked as known to be
+ working.
+ </para>
+ <para>Plugins are used for performing the tests and new plugins can be
+ written. They are stored in the
+ <filename>/usr/lib/health-checker</filename> directory and executed either
+ with the option <command>check</command> or <command>stop</command>.
+ If called with "check", the plugin should verify that the service works and
+ return 0, else 1. If one plugin returns "1", <command>health-check</command>
+ will evaluate what to do. If neither a rollback or reboot is usefull, all
+ plugins will be called with the "stop" option. In this case, the plugins
should shutdown the services are far as possible and usefull.
-</para>
-</refsect1>
-
-<refsect1 id='see_also'><title>SEE ALSO</title>
-<para><citerefentry><refentrytitle>transactional-update</refentrytitle><manvolnum>8</manvolnum></citerefentry>
-</para>
-</refsect1>
+ </para>
+ </refsect1>
+ <refsect1 id='telemetry'><title>TELEMETRY</title>
+ <para>
+ If
<citerefentry><refentrytitle>telem-record-gen</refentrytitle><manvolnum>1</manvolnum></citerefentry>
+ is installed telemetry events are created additional to logging with
+
<citerefentry><refentrytitle>syslog</refentrytitle><manvolnum>3</manvolnum></citerefentry>.
+ </para>
+ </refsect1>
+
+ <refsect1 id='see_also'><title>SEE ALSO</title>
+
<para><citerefentry><refentrytitle>transactional-update</refentrytitle><manvolnum>8</manvolnum></citerefentry>
+ </para>
+ </refsect1>
</refentry>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh
old/health-checker-1.0/man/health-checker.index.html
new/health-checker-1.3.1/man/health-checker.index.html
--- old/health-checker-1.0/man/health-checker.index.html 2017-05-16
16:07:28.000000000 +0200
+++ new/health-checker-1.3.1/man/health-checker.index.html 2019-12-05
17:54:24.000000000 +0100
@@ -1,4 +1,4 @@
-<html><head><meta http-equiv="Content-Type" content="text/html;
charset=UTF-8"><title>health-checker.index</title><meta name="generator"
content="DocBook XSL Stylesheets V1.78.1"></head><body bgcolor="white"
text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><style>
+<html><head><meta http-equiv="Content-Type" content="text/html;
charset=UTF-8"><title>health-checker.index</title><meta name="generator"
content="DocBook XSL Stylesheets Vsnapshot"></head><body bgcolor="white"
text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><style>
a.headerlink {
color: #c60f0f;
font-size: 0.8em;
@@ -15,4 +15,4 @@
h1:hover > a.headerlink, h2:hover > a.headerlink, h3:hover > a.headerlink,
dt:hover > a.headerlink {
visibility: visible;
}
- </style><a href="health-checker.index.html">Index </a><span
style="float:right">health-checker 0.3</span><hr><div class="refentry"><a
name="health-checker.index"></a><div class="titlepage"></div><div
class="refnamediv"><h2>Name</h2><p>health-checker.index — List all manpages
from the health-checker project</p></div><div class="refsect1"><a
name="id-1.4"></a><h2 id="H">H<a class="headerlink" title="Permalink to this
headline" href="#H">¶</a></h2><p><a href="health-checker.8.html"><span
class="citerefentry"><span
class="refentrytitle">health-checker</span>(8)</span></a> -- Checks that all
important services of a system did come up correctly after an update and
reboot.<br><a href="health-checker.service.8.html"><span
class="citerefentry"><span
class="refentrytitle">health-checker.service</span>(8)</span></a> -- Checks
that all important services of a system did come up correctly after an update
and reboot.<br></p></div><div class="refsect1"><a name="id-1.5"></a><p><a
name="counts"></a>This index contains 2 entries, referring to 1 individual
manual pages.</p></div></div></body></html>
+ </style><a href="health-checker.index.html">Index </a><span
style="float:right">health-checker 1.2.3</span><hr><div class="refentry"><a
name="health-checker.index"></a><div class="titlepage"></div><div
class="refnamediv"><h2>Name</h2><p>health-checker.index — List all manpages
from the health-checker project</p></div><div class="refsect1"><a
name="id-1.4"></a><h2 id="H">H<a class="headerlink" title="Permalink to this
headline" href="#H">¶</a></h2><p><a href="health-checker.8.html"><span
class="citerefentry"><span
class="refentrytitle">health-checker</span>(8)</span></a> -- Checks that all
important services of a system did come up correctly after an update and
reboot.<br><a href="health-checker.service.8.html"><span
class="citerefentry"><span
class="refentrytitle">health-checker.service</span>(8)</span></a> -- Checks
that all important services of a system did come up correctly after an update
and reboot.<br></p></div><div class="refsect1"><a name="id-1.5"></a><p><a
name="counts"></a>This index contains 2 entries, referring to 1 individual
manual pages.</p></div></div></body></html>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh
old/health-checker-1.0/man/health-checker.service.8.html
new/health-checker-1.3.1/man/health-checker.service.8.html
--- old/health-checker-1.0/man/health-checker.service.8.html 2017-05-16
16:07:28.000000000 +0200
+++ new/health-checker-1.3.1/man/health-checker.service.8.html 2019-12-05
17:52:48.000000000 +0100
@@ -1,4 +1,4 @@
-<html><head><meta http-equiv="Content-Type" content="text/html;
charset=UTF-8"><title>health-checker</title><meta name="generator"
content="DocBook XSL Stylesheets V1.78.1"></head><body bgcolor="white"
text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><style>
+<html><head><meta http-equiv="Content-Type" content="text/html;
charset=UTF-8"><title>health-checker</title><meta name="generator"
content="DocBook XSL Stylesheets Vsnapshot"></head><body bgcolor="white"
text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><style>
a.headerlink {
color: #c60f0f;
font-size: 0.8em;
@@ -15,25 +15,29 @@
h1:hover > a.headerlink, h2:hover > a.headerlink, h3:hover > a.headerlink,
dt:hover > a.headerlink {
visibility: visible;
}
- </style><a href="health-checker.index.html">Index </a><span
style="float:right">health-checker 0.3</span><hr><div class="refentry"><a
name="health-checker.8"></a><div class="titlepage"></div><div
class="refnamediv"><a name="name"></a><h2>Name</h2><p>health-checker,
health-checker.service — Checks that all important services of a system did
come up
+ </style><a href="health-checker.index.html">Index </a><span
style="float:right">health-checker 1.2.3</span><hr><div class="refentry"><a
name="health-checker.8"></a><div class="titlepage"></div><div
class="refnamediv"><a name="name"></a><h2>Name</h2><p>health-checker,
health-checker.service — Checks that all important services of a system did
come up
correctly after an update and reboot.</p></div><div
class="refsynopsisdiv"><a name="synopsis"></a><h2>Synopsis</h2><div
class="cmdsynopsis"><p><code class="command">/usr/sbin/health-checker</code>
</p></div><div class="cmdsynopsis"><p><code
class="command">/usr/sbin/health-checker</code> --version </p></div><p><code
class="filename">health-checker.service</code></p></div><div
class="refsect1"><a name="description"></a><h2 id="DESCRIPTION">DESCRIPTION<a
class="headerlink" title="Permalink to this headline"
href="#DESCRIPTION">¶</a></h2><p><span
class="emphasis"><em>health-checker</em></span>
-checks during boot, if the system is coming up correct.
-In error case, the action depends on what did happen before. If this is the
-first boot after a transactional update, an automatic rollback to the last
-known working snapshot is made. If the snapshot was already rebooted
-successfull before, a reboot is tried. If this does not help, some sevices are
-shutdown and an admin has to repair the system.
-</p><p>
-If the boot was successfull, the current snapshot is marked as known to be
-working.
-</p><p>Plugins are used for performing the tests and new plugins can be
-written. They are stored in the
-<code class="filename">/usr/lib/health-checker</code> directory and executed
either
-with the option <span class="command"><strong>check</strong></span> or <span
class="command"><strong>stop</strong></span>.
-If called with "check", the plugin should verify that the service works and
-return 0, else 1. If one plugin returns "1", <span
class="command"><strong>health-check</strong></span>
-will evaluate what to do. If neither a rollback or reboot is usefull, all
-plugins will be called with the "stop" option. In this case, the plugins
+ checks during boot, if the system is coming up correct.
+ In error case, the action depends on what did happen before. If this is the
+ first boot after a transactional update, an automatic rollback to the last
+ known working snapshot is made. If the snapshot was already rebooted
+ successfull before, a reboot is tried. If this does not help, some sevices
+ are shutdown and an admin has to repair the system.
+ </p><p>
+ If the boot was successfull, the current snapshot is marked as known to be
+ working.
+ </p><p>Plugins are used for performing the tests and new plugins can be
+ written. They are stored in the
+ <code class="filename">/usr/lib/health-checker</code> directory and executed
either
+ with the option <span class="command"><strong>check</strong></span> or <span
class="command"><strong>stop</strong></span>.
+ If called with "check", the plugin should verify that the service works and
+ return 0, else 1. If one plugin returns "1", <span
class="command"><strong>health-check</strong></span>
+ will evaluate what to do. If neither a rollback or reboot is usefull, all
+ plugins will be called with the "stop" option. In this case, the plugins
should shutdown the services are far as possible and usefull.
-</p></div><div class="refsect1"><a name="see_also"></a><h2 id="SEE ALSO">SEE
ALSO<a class="headerlink" title="Permalink to this headline"
href="#SEE%20ALSO">¶</a></h2><p><a href="transactional-update.8.html"><span
class="citerefentry"><span
class="refentrytitle">transactional-update</span>(8)</span></a>
-</p></div></div></body></html>
+ </p></div><div class="refsect1"><a name="telemetry"></a><h2
id="TELEMETRY">TELEMETRY<a class="headerlink" title="Permalink to this
headline" href="#TELEMETRY">¶</a></h2><p>
+ If <a href="telem-record-gen.1.html"><span class="citerefentry"><span
class="refentrytitle">telem-record-gen</span>(1)</span></a>
+ is installed telemetry events are created additional to logging with
+ <a href="syslog.3.html"><span class="citerefentry"><span
class="refentrytitle">syslog</span>(3)</span></a>.
+ </p></div><div class="refsect1"><a name="see_also"></a><h2 id="SEE ALSO">SEE
ALSO<a class="headerlink" title="Permalink to this headline"
href="#SEE%20ALSO">¶</a></h2><p><a href="transactional-update.8.html"><span
class="citerefentry"><span
class="refentrytitle">transactional-update</span>(8)</span></a>
+ </p></div></div></body></html>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh
old/health-checker-1.0/missing new/health-checker-1.3.1/missing
--- old/health-checker-1.0/missing 2017-04-21 13:46:41.000000000 +0200
+++ new/health-checker-1.3.1/missing 2019-12-05 17:52:41.000000000 +0100
@@ -1,9 +1,9 @@
#! /bin/sh
# Common wrapper for a few potentially missing GNU programs.
-scriptversion=2012-06-26.16; # UTC
+scriptversion=2018-03-07.03; # UTC
-# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+# Copyright (C) 1996-2018 Free Software Foundation, Inc.
# Originally written by Fran,cois Pinard <[email protected]>, 1996.
# This program is free software; you can redistribute it and/or modify
@@ -17,7 +17,7 @@
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
@@ -101,9 +101,9 @@
exit $st
fi
-perl_URL=http://www.perl.org/
-flex_URL=http://flex.sourceforge.net/
-gnu_software_URL=http://www.gnu.org/software
+perl_URL=https://www.perl.org/
+flex_URL=https://github.com/westes/flex
+gnu_software_URL=https://www.gnu.org/software
program_details ()
{
@@ -160,7 +160,7 @@
;;
autom4te*)
echo "You might have modified some maintainer files that require"
- echo "the 'automa4te' program to be rebuilt."
+ echo "the 'autom4te' program to be rebuilt."
program_details 'autom4te'
;;
bison*|yacc*)
@@ -207,9 +207,9 @@
exit $st
# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
+# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh
old/health-checker-1.0/plugins/Makefile.am
new/health-checker-1.3.1/plugins/Makefile.am
--- old/health-checker-1.0/plugins/Makefile.am 2017-05-18 13:55:14.000000000
+0200
+++ new/health-checker-1.3.1/plugins/Makefile.am 2019-03-29
00:01:36.000000000 +0100
@@ -5,6 +5,6 @@
plugindir = @PLUGINDIR@
plugin_SCRIPTS = health-check-tester.sh etcd.sh etc-overlayfs.sh \
- rebootmgr.sh btrfs-subvolumes-mounted.sh
+ rebootmgr.sh btrfs-subvolumes-mounted.sh crio.sh kubelet.sh
EXTRA_DIST = template.sh ${SCRIPTS}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh
old/health-checker-1.0/plugins/crio.sh new/health-checker-1.3.1/plugins/crio.sh
--- old/health-checker-1.0/plugins/crio.sh 1970-01-01 01:00:00.000000000
+0100
+++ new/health-checker-1.3.1/plugins/crio.sh 2019-12-04 15:30:19.000000000
+0100
@@ -0,0 +1,33 @@
+#!/bin/bash
+
+run_checks() {
+ # Check first if it is installed:
+ rpm -q --quiet cri-o
+ test $? -ne 0 && return
+
+ # ignore if crio is not enabled.
+ systemctl is-enabled -q crio
+ test $? -ne 0 && return
+
+ systemctl is-failed -q crio
+ test $? -ne 1 && exit 1
+}
+
+stop_services() {
+ systemctl stop crio
+}
+
+case "$1" in
+ check)
+ run_checks
+ ;;
+ stop)
+ stop_services
+ ;;
+ *)
+ echo "Usage: $0 {check|stop}"
+ exit 1
+ ;;
+esac
+
+exit 0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh
old/health-checker-1.0/plugins/health-check-tester.sh
new/health-checker-1.3.1/plugins/health-check-tester.sh
--- old/health-checker-1.0/plugins/health-check-tester.sh 2017-03-24
15:13:14.000000000 +0100
+++ new/health-checker-1.3.1/plugins/health-check-tester.sh 2019-03-29
00:01:36.000000000 +0100
@@ -1,7 +1,7 @@
#!/bin/bash
#
-# plugin to test basic functionality of CaaSP health checker
+# plugin to test basic functionality of MicroOS health checker
#
run_checks() {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh
old/health-checker-1.0/plugins/kubelet.sh
new/health-checker-1.3.1/plugins/kubelet.sh
--- old/health-checker-1.0/plugins/kubelet.sh 1970-01-01 01:00:00.000000000
+0100
+++ new/health-checker-1.3.1/plugins/kubelet.sh 2020-01-30 13:22:35.000000000
+0100
@@ -0,0 +1,29 @@
+#!/bin/bash
+
+run_checks() {
+ # ignore if kubelet is not enabled.
+ systemctl is-enabled -q kubelet
+ test $? -ne 0 && return
+
+ systemctl is-failed -q kubelet
+ test $? -ne 1 && exit 1
+}
+
+stop_services() {
+ systemctl stop kubelet
+}
+
+case "$1" in
+ check)
+ run_checks
+ ;;
+ stop)
+ stop_services
+ ;;
+ *)
+ echo "Usage: $0 {check|stop}"
+ exit 1
+ ;;
+esac
+
+exit 0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh
old/health-checker-1.0/sbin/health-checker.in
new/health-checker-1.3.1/sbin/health-checker.in
--- old/health-checker-1.0/sbin/health-checker.in 2018-05-23
12:30:37.000000000 +0200
+++ new/health-checker-1.3.1/sbin/health-checker.in 2020-01-29
15:37:39.000000000 +0100
@@ -13,19 +13,68 @@
STATE_FILE=/var/lib/misc/health-check.state
REBOOTED_STATE=/var/lib/misc/health-check.rebooted
PLUGINDIR=@PLUGINDIR@
+TELEM_SEVERITY=1
+TELEM_PAYLOAD=""
-BTRFS_ID=0
+BTRFS_ID_DEFAULT=0
+BTRFS_ID_CURRENT=0
set_btrfs_id()
{
- BTRFS_ID=`btrfs subvolume get-default / | awk '{print $2}'`
+ BTRFS_ID_DEFAULT=`btrfs subvolume get-default / | awk '{print $2}'`
+ BTRFS_ID_CURRENT=`findmnt --output OPTIONS --noheadings / | sed -e
's|.*subvolid=\([0-9]\+\).*|\1|g'`
+}
+
+create_log()
+{
+ local SEVERITY=1
+
+ logger -s -p $1 $2
+
+ # Create severity and payload for telemetrics if available
+ case $1 in
+ user.emerg)
+ SEVERITY=4
+ ;;
+ user.crit)
+ SEVERITY=3
+ ;;
+ user.alert)
+ SEVERITY=2
+ ;;
+ *)
+ SEVERITY=1
+ ;;
+ esac
+
+ if [ $SEVERITY -gt $TELEM_SEVERITY ]; then
+ TELEM_SEVERITY=$SEVERITY
+ fi
+ if [ -z "${TELEM_PAYLOAD}" ]; then
+ TELEM_PAYLOAD=$2
+ else
+ TELEM_PAYLOAD="${TELEM_PAYLOAD}\n$2"
+ fi
+}
+
+telem_send_record()
+{
+ # Log via telemetrics if available
+ if [ -x /usr/bin/telem-record-gen ]; then
+ echo -e "${TELEM_PAYLOAD}" | /usr/bin/telem-record-gen -s
$TELEM_SEVERITY -c "org.opensuse/health/boot"
+ # Communiction is async, give daemon time to send data
+ # before we reboot
+ test "$1" = "1" && sleep 2
+ fi
}
save_working_snapshot()
{
set_btrfs_id
- echo "LAST_WORKING_BTRFS_ID=${BTRFS_ID}" > $STATE_FILE
+ if [ ${BTRFS_ID_DEFAULT} -eq ${BTRFS_ID_CURRENT} ]; then
+ echo "LAST_WORKING_BTRFS_ID=${BTRFS_ID_DEFAULT}" > $STATE_FILE
+ fi
}
rollback()
@@ -33,7 +82,8 @@
. ${STATE_FILE}
btrfs subvolume set-default ${LAST_WORKING_BTRFS_ID} /.snapshots
if [ $? -ne 0 ]; then
- logger -s -p user.crit "ERROR: btrfs set-default $BTRFS_ID failed!"
+ create_log user.crit "ERROR: btrfs set-default $BTRFS_ID_DEFAULT
failed!"
+ telem_send_playload 1
exit 1
fi
}
@@ -42,7 +92,7 @@
{
# stop all services
for script in ${PLUGINDIR}/* ; do
- ${script} stop
+ ${script} stop
done
}
@@ -50,7 +100,7 @@
{
if [ ! -f ${STATE_FILE} ]; then
# No state file, no successfull boot
- logger -s -p user.emerg "Machine didn't come up correct, stop services"
+ create_log user.emerg "Machine didn't come up correct, stop services"
stop_services
return
fi
@@ -59,18 +109,24 @@
set_btrfs_id
- if [ ${LAST_WORKING_BTRFS_ID} -ne ${BTRFS_ID} ]; then
- logger -s -p user.alert "Machine didn't come up correct, do a rollback"
+ if [ ${BTRFS_ID_DEFAULT} -ne ${BTRFS_ID_CURRENT} ]; then
+ # Don't tamper with system if not booted into default snapshot
+ create_log user.alert "Machine didn't come up correct, trying rebooting
into default snapshot"
+ systemctl reboot
+ elif [ ${LAST_WORKING_BTRFS_ID} -ne ${BTRFS_ID_DEFAULT} ]; then
+ create_log user.alert "Machine didn't come up correct, do a rollback"
rollback
if [ $? -eq 0 ]; then
+ telem_send_record 1
systemctl reboot
fi
elif [ ! -f ${REBOOTED_STATE} ]; then
- logger -s -p user.crit "Machine didn't come up correct, try a reboot"
+ create_log user.crit "Machine didn't come up correct, try a reboot"
echo `date "+%Y-%m-%d %H:%M"` > ${REBOOTED_STATE}
+ telem_send_record 1
systemctl reboot
else
- logger -s -p user.emerg "Machine didn't come up correct, stop services"
+ create_log user.emerg "Machine didn't come up correct, stop services"
stop_services
fi
}
@@ -84,7 +140,7 @@
for script in ${PLUGINDIR}/* ; do
${script} check
if [ $? -ne 0 ]; then
- logger -s -p user.crit "ERROR: \"${script} check\" failed"
+ create_log user.crit "ERROR: \"${script} check\" failed"
FAILED=1
fi
done
@@ -92,12 +148,21 @@
if [ ${FAILED} -ne 0 ]; then
echo "Health check failed!"
error_decission
+ telem_send_record 0
exit 1
else
echo "Health check passed"
# Save good working state and remove old rebooted state file
save_working_snapshot
- rm -rf ${REBOOTED_STATE}
+ if [ -f ${REBOOTED_STATE} ]; then
+ create_log user.info "Health check passed after reboot"
+ rm -rf ${REBOOTED_STATE}
+ fi
fi
+
+if [ -z "${TELEM_PAYLOAD}" ]; then
+ TELEM_PAYLOAD="Health check passed"
+fi
+telem_send_record 0
exit 0
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' --exclude Makefile.in --exclude configure --exclude
config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4
--exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh
old/health-checker-1.0/systemd/health-checker.service
new/health-checker-1.3.1/systemd/health-checker.service
--- old/health-checker-1.0/systemd/health-checker.service 2017-03-24
15:07:50.000000000 +0100
+++ new/health-checker-1.3.1/systemd/health-checker.service 2019-03-29
00:01:36.000000000 +0100
@@ -1,8 +1,9 @@
[Unit]
-Description=CaaSP Health Checker
-After=etcd.service
-After=flanneld.service
+Description=MicroOS Health Checker
After=cloud-final.service
+After=crio.service
+After=etcd.service
+After=kubelet.service
After=rebootmgr.service
Wants=local-fs.target