[Midnightbsd-cvs] src [11783] add world status

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Wed Jul 11 19:53:46 EDT 2018


Revision: 11783
          http://svnweb.midnightbsd.org/src/?rev=11783
Author:   laffer1
Date:     2018-07-11 19:53:45 -0400 (Wed, 11 Jul 2018)
Log Message:
-----------
add world status

Modified Paths:
--------------
    trunk/etc/periodic/daily/800.scrub-zfs

Added Paths:
-----------
    trunk/etc/periodic/daily/510.status-world-kernel

Property Changed:
----------------
    trunk/etc/periodic/daily/800.scrub-zfs

Added: trunk/etc/periodic/daily/510.status-world-kernel
===================================================================
--- trunk/etc/periodic/daily/510.status-world-kernel	                        (rev 0)
+++ trunk/etc/periodic/daily/510.status-world-kernel	2018-07-11 23:53:45 UTC (rev 11783)
@@ -0,0 +1,36 @@
+#!/bin/sh
+#
+# $MidnightBSD$
+#
+# Check that the running userland and kernel versions are in sync.
+
+# If there is a global system configuration file, suck it in.
+#
+if [ -r /etc/defaults/periodic.conf ]
+then
+    . /etc/defaults/periodic.conf
+    source_periodic_confs
+fi
+
+case "$daily_status_world_kernel" in
+    [Yy][Ee][Ss])
+	rc=0
+	_U=$(/usr/bin/uname -U 2>/dev/null)
+	_K=$(/usr/bin/uname -K 2>/dev/null)
+	[ -z "${_U}" -o -z "${_K}" ] && exit 0
+	echo ""
+	echo "Checking userland and kernel versions:"
+	if [ "${_U}" != "${_K}" ]; then
+	    echo "Userland and kernel are not in sync"
+	    echo "Userland version: ${_U}"
+	    echo "Kernel version: ${_K}"
+	    rc=1
+	else
+	    echo "Userland and kernel are in sync."
+	fi
+	;;
+
+    *)  rc=0;;
+esac
+
+exit $rc


Property changes on: trunk/etc/periodic/daily/510.status-world-kernel
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Modified: trunk/etc/periodic/daily/800.scrub-zfs
===================================================================
--- trunk/etc/periodic/daily/800.scrub-zfs	2018-07-11 23:53:24 UTC (rev 11782)
+++ trunk/etc/periodic/daily/800.scrub-zfs	2018-07-11 23:53:45 UTC (rev 11783)
@@ -43,6 +43,10 @@
 			rc=3
 			echo "Skipping faulted pool: ${pool}"
 			continue ;;
+		*UNAVAIL*)
+			rc=4
+			echo "Skipping unavailable pool: ${pool}"
+			continue ;;
 		esac
 
 		# determine how many days shall be between scrubs
@@ -59,6 +63,11 @@
 			_last_scrub=$(zpool history ${pool} | \
 			    sed -ne '2s/ .*$//p')
 		fi
+		if [ -z "${_last_scrub}" ]; then
+			echo "   skipping scrubbing of pool '${pool}':"
+			echo "      can't get last scrubbing date"
+			continue
+		fi
 
 		# Now minus last scrub (both in seconds) converted to days.
 		_scrub_diff=$(expr -e \( $(date +%s) - \


Property changes on: trunk/etc/periodic/daily/800.scrub-zfs
___________________________________________________________________
Deleted: svn:executable
## -1 +0,0 ##
-*
\ No newline at end of property


More information about the Midnightbsd-cvs mailing list