File update_rtcheck_to_devel-bnc623542.diff of Package ibmrtpkgs.15904

Subject: update rtcheck
From: vernux@us.ibm.com
Date: 2010-07-29 14:37:17 UTC
References: bnc#623542

diff -Napur ibmrtpkgs-2/rtcheck/rtcheck.init.rhel ibmrtpkgs-2.new/rtcheck/rtcheck.init.rhel
--- ibmrtpkgs-2/rtcheck/rtcheck.init.rhel	1970-01-01 01:00:00.000000000 +0100
+++ ibmrtpkgs-2.new/rtcheck/rtcheck.init.rhel	2008-11-04 21:49:38.070379000 +0100
@@ -0,0 +1,49 @@
+#!/bin/bash
+#
+# © Copyright IBM Corp. 2008.  All Rights Reserved.
+#
+# chkconfig: 234 01 99
+#
+# description: rtcheck checks if the system is Real Time capable.
+#              A run at boot time by root caches all user independent
+#              tests to increase performance at run time.
+
+# source function library
+. /etc/init.d/functions
+
+RETVAL=0
+
+start() {
+	echo -n $"Checking if system is Real Time capable: "
+	/usr/bin/rtcheck -v > /var/log/rtcheck
+	RETVAL=$?
+	if [ $RETVAL ]; then
+		echo "yes"
+	else
+		echo "no"
+	fi
+}
+
+stop() {
+	# reset rtcheck's system cache
+	rm -f /var/cache/rtcheck
+}
+
+case "$1" in
+	start)
+		start
+		;;
+	stop)
+		stop
+		;;
+	restart)
+		stop
+		start
+		;;
+	*)
+		echo $"Usage: $0 {start|stop|restart}"
+		exit 1
+		;;
+esac
+
+exit $RETVAL
diff -Napur ibmrtpkgs-2/rtcheck/rtcheck.init.suse ibmrtpkgs-2.new/rtcheck/rtcheck.init.suse
--- ibmrtpkgs-2/rtcheck/rtcheck.init.suse	1970-01-01 01:00:00.000000000 +0100
+++ ibmrtpkgs-2.new/rtcheck/rtcheck.init.suse	2008-11-04 21:49:38.072369000 +0100
@@ -0,0 +1,63 @@
+#!/bin/bash
+#
+# © Copyright IBM Corp. 2008.  All Rights Reserved.
+#
+# description: rtcheck checks if the system is Real Time capable.
+#              A run at boot time by root caches all user independent
+#              tests to increase performance at run time.
+#
+### BEGIN INIT INFO
+# Provides: rtcheck
+# Required-Start:
+# Required-Stop:
+# Default-Start: 2 3 5
+# Default-Stop: 1 6
+# Description: Run rtcheck system tests
+### END INIT INFO
+
+
+# source function library
+. /etc/rc.status
+
+rc_reset
+
+RETVAL=0
+
+start() {
+	echo -n $"Checking if system is Real Time capable: "
+
+	/usr/bin/rtcheck -v > /var/log/rtcheck
+	RETVAL=$?
+
+	# because this is for global tests only,
+	# return of 1 or 0 is acceptable
+	# 0 => all tests passed
+	# 1 => memlock (per-user-test) failed
+	[[ "$RETVAL" -eq 1 ]] || [[ "$RETVAL" -eq 0 ]]
+
+	rc_status -v
+}
+
+stop() {
+	# reset rtcheck's system cache
+	rm -f /var/cache/rtcheck
+}
+
+case "$1" in
+	start)
+		start
+		;;
+	stop)
+		stop
+		;;
+	restart)
+		stop
+		start
+		;;
+	*)
+		echo $"Usage: $0 {start|stop|restart}"
+		exit 1
+		;;
+esac
+
+exit $RETVAL
openSUSE Build Service is sponsored by