slackbuilds_ponce/system/watchdog/watchdog-5.4-slackware.diff
2010-05-11 19:46:45 +02:00

70 lines
1.9 KiB
Diff

diff -Nur watchdog-5.4.orig/examples/repair.sh watchdog-5.4/examples/repair.sh
--- watchdog-5.4.orig/examples/repair.sh 2006-07-30 05:50:06.000000000 -0500
+++ watchdog-5.4/examples/repair.sh 2008-03-02 12:58:08.086346303 -0600
@@ -48,6 +48,9 @@
elif [ -x /etc/init.d/networking ]; then
# Debian
/etc/init.d/networking stop
+ elif [ -x /etc/rc.d/rc.inet1 ]; then
+ # Slackware
+ /etc/rc.d/rc.inet1 stop
else
ifconfig |
awk '/Link/ {print $1}' |
@@ -79,6 +82,9 @@
elif [ -x /etc/rc.d/init.d/network ]; then
# Redhat
/etc/rc.d/init.d/network start
+elif [ -x /etc/rc.d/rc.inet1 ]; then
+ # Slackware
+ /etc/rc.d/rc.inet1 start
else
echo "Couldn't find network script to relaunch networking. Please edit $0" | logger -i -t repair -p daemon.info
exit $1
diff -Nur watchdog-5.4.orig/rc.watchdog.slackware watchdog-5.4/rc.watchdog.slackware
--- watchdog-5.4.orig/rc.watchdog.slackware 1969-12-31 18:00:00.000000000 -0600
+++ watchdog-5.4/rc.watchdog.slackware 2008-03-02 12:58:08.086346303 -0600
@@ -0,0 +1,43 @@
+#!/bin/sh
+#
+# /etc/rc.d/rc.watchdog
+#
+# Start/stop/restart the watchdog timer service.
+
+watchdog_start() {
+ if [ ! -e /dev/watchdog ]; then
+ echo "$0: No /dev/watchdog device node seems to exist on this system."
+ echo "$0: A kernel module probably needs to be loaded; please see:"
+ echo "$0: /usr/src/linux/Documentation/watchdog/watchdog-api.txt"
+ exit 0
+ fi
+ if [ -x /usr/sbin/watchdog -a -r /etc/watchdog.conf ]; then
+ echo "Starting the watchdog timer service: /usr/sbin/watchdog"
+ /usr/sbin/watchdog
+ fi
+}
+
+watchdog_stop() {
+ killall watchdog
+}
+
+watchdog_restart() {
+ watchdog_stop
+ sleep 10 # can take a while to die
+ watchdog_start
+}
+
+case "$1" in
+'start')
+ watchdog_start
+ ;;
+'stop')
+ watchdog_stop
+ ;;
+'restart')
+ watchdog_restart
+ ;;
+*)
+ echo $"Usage: $0 {start|stop|restart}"
+esac
+