summaryrefslogtreecommitdiff
path: root/recipes-support/multitech/softdog-mon/init
diff options
context:
space:
mode:
authorJohn Klug <john.klug@multitech.com>2021-01-29 04:44:00 -0600
committerJohn Klug <john.klug@multitech.com>2021-01-29 04:44:00 -0600
commitee2141f2cd55a5d842ffde85cf6c37b26fe3c3df (patch)
treeb65d5934ebed487628fbda93ff0d96a6fe51b77d /recipes-support/multitech/softdog-mon/init
parent447cfe90c34aa0d52217644d20e939c57bb34d3e (diff)
downloadmeta-mlinux-ee2141f2cd55a5d842ffde85cf6c37b26fe3c3df.tar.gz
meta-mlinux-ee2141f2cd55a5d842ffde85cf6c37b26fe3c3df.tar.bz2
meta-mlinux-ee2141f2cd55a5d842ffde85cf6c37b26fe3c3df.zip
Move softdog-mon recipes into correct part of tree
Diffstat (limited to 'recipes-support/multitech/softdog-mon/init')
-rwxr-xr-xrecipes-support/multitech/softdog-mon/init69
1 files changed, 69 insertions, 0 deletions
diff --git a/recipes-support/multitech/softdog-mon/init b/recipes-support/multitech/softdog-mon/init
new file mode 100755
index 0000000..a02ab1a
--- /dev/null
+++ b/recipes-support/multitech/softdog-mon/init
@@ -0,0 +1,69 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides: softdog-mon
+# Required-Start: $remote_fs
+# Required-Stop: $remote_fs
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Advanced Power Management daemon
+### END INIT INFO
+
+# Source function library.
+. /etc/init.d/functions
+if [ -r /etc/default/softdog-mon ] ; then
+ . /etc/default/softdog-mon
+fi
+
+LOG="logger -s -t 'softdog-mon' -p"
+PATH=/bin:/usr/bin:/sbin:/usr/sbin
+
+[ -f /etc/default/rcS ] && . /etc/default/rcS
+[ -f /etc/default/softdog-mon ] && . /etc/default/softdog-mon
+
+if ! [[ -c $WATCHDOGDEV ]] ; then
+ $LOG daemon.err "ERROR: device \"$WATCHDOGDEV\" was not found"
+ exit 1
+fi
+
+if [[ -z $TIMEOUT ]] ; then
+ $LOG daemon.err "ERROR: timeout \"$TIMEOUT\" was not found"
+ exit 1
+fi
+
+# Use NICE of zero if not set.
+: ${NICE:=0}
+
+
+case "$1" in
+ start)
+ echo -n "Starting softdog monitor daemon: "
+ /usr/sbin/start-stop-daemon -N $NICE \
+ -S -x /usr/sbin/softdog-mon -- $WATCHDOGDEV $TIMEOUT
+ if [ $? = 0 ]; then
+ echo "softdog-mon."
+ else
+ echo "(failed.)"
+ fi
+ ;;
+ stop)
+ echo -n "Stopping softdog monitor daemon: "
+ /usr/sbin/start-stop-daemon -K \
+ -x /usr/sbin/softdog-mon
+ echo "softdog-mon."
+ ;;
+ status)
+ status /usr/sbin/softdog-mon;
+ exit $?
+ ;;
+ restart|force-reload)
+ $0 stop
+ $0 start
+ exit
+ ;;
+ *)
+ echo "Usage: /etc/init.d/softdog-mon {start|stop|status|restart|force-reload}"
+ exit 1
+ ;;
+esac
+
+exit 0