summaryrefslogtreecommitdiff
path: root/recipes-core/multitech/reset-handler/reset-handler.init
diff options
context:
space:
mode:
authorJesse Gilles <jgilles@multitech.com>2014-11-04 11:51:34 -0600
committerJesse Gilles <jgilles@multitech.com>2014-11-04 11:51:34 -0600
commite243c30f04c18722dc65effe6d4f275a3f35de46 (patch)
tree807610ce8af0ead02681d6c3cc89d902ec941652 /recipes-core/multitech/reset-handler/reset-handler.init
downloadmeta-mlinux-e243c30f04c18722dc65effe6d4f275a3f35de46.tar.gz
meta-mlinux-e243c30f04c18722dc65effe6d4f275a3f35de46.tar.bz2
meta-mlinux-e243c30f04c18722dc65effe6d4f275a3f35de46.zip
initial commit of mLinux layer
Diffstat (limited to 'recipes-core/multitech/reset-handler/reset-handler.init')
-rw-r--r--recipes-core/multitech/reset-handler/reset-handler.init30
1 files changed, 30 insertions, 0 deletions
diff --git a/recipes-core/multitech/reset-handler/reset-handler.init b/recipes-core/multitech/reset-handler/reset-handler.init
new file mode 100644
index 0000000..b50e7b8
--- /dev/null
+++ b/recipes-core/multitech/reset-handler/reset-handler.init
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+DAEMON=/usr/sbin/reset-handler
+PIDFILE=/var/run/reset-handler.pid
+ENABLED="yes"
+
+[ -r /etc/default/reset-handler ] && . /etc/default/reset-handler
+[ -x $DAEMON ] || exit 0
+[ "$ENABLED" = "yes" ] || exit 0
+
+case "$1" in
+ start)
+ if [ -f $PIDFILE ]; then
+ echo "reset-handler pid file exists, not starting"
+ exit 1
+ else
+ echo "Starting reset-handler"
+ start-stop-daemon --start --background --make-pidfile --pidfile $PIDFILE --exec $DAEMON
+ fi
+ ;;
+ stop)
+ echo "Stopping reset-handler"
+ start-stop-daemon --stop --oknodo --pidfile $PIDFILE
+ rm -f $PIDFILE
+ ;;
+ *)
+ echo "Usage: $0 {start|stop}"
+ exit 2
+ ;;
+esac