summaryrefslogtreecommitdiff
path: root/testscripts/Meego
diff options
context:
space:
mode:
authorChristian Muck <christian.muck@bmw.de>2011-09-16 14:37:31 +0200
committerChristian Muck <christian.muck@bmw.de>2011-09-16 14:37:31 +0200
commit3d66b53ceb985014b0ae72cad6cafe8c07325209 (patch)
tree107efb69cc2369c9c080a46b6c0ee0c12fdb2b40 /testscripts/Meego
parent101dab1a5261189a13068810ee57fe76b64ad909 (diff)
downloadDLT-daemon-3d66b53ceb985014b0ae72cad6cafe8c07325209.tar.gz
Bugfix [GSW-72] Can't open /etc/rc.d/init.d/functions. Provide versions for different distros
Diffstat (limited to 'testscripts/Meego')
-rwxr-xr-xtestscripts/Meego/dlt-daemon.cmake83
1 files changed, 83 insertions, 0 deletions
diff --git a/testscripts/Meego/dlt-daemon.cmake b/testscripts/Meego/dlt-daemon.cmake
new file mode 100755
index 0000000..a2e908e
--- /dev/null
+++ b/testscripts/Meego/dlt-daemon.cmake
@@ -0,0 +1,83 @@
+#!/bin/sh
+#
+# Starts the DLT Daemon
+#
+# chkconfig: 2345 21 87
+# description: Provides DLT Debug Logging & Trace functionality
+# processname: dlt-daemon
+
+# Source function library.
+. /etc/rc.d/init.d/functions
+
+
+processname=dlt-daemon
+processpath=@CMAKE_INSTALL_PREFIX@/bin
+servicename=dlt-daemon
+
+
+[ -x $processpath ] || exit 0
+
+start() {
+ echo -n $"Starting $processname daemon: "
+ @CMAKE_INSTALL_PREFIX@/bin/dlt-daemon -d
+}
+
+stop() {
+ echo -n $"Stopping $processname daemon: "
+ killproc $servicename -TERM
+ RETVAL=$?
+ echo
+ [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$servicename
+}
+
+RETVAL=0
+
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ restart)
+ stop
+ start
+ ;;
+ condrestart)
+ if [ -f /var/lock/subsys/$servicename ]; then
+ stop
+ start
+ fi
+ ;;
+ reload)
+ restart
+ ;;
+ status)
+ status $processname
+ pidofdlt=`pidof $processname`
+ if [ $pidofdlt ]
+ then
+ echo "DLT Deamon is running with PID:$pidofdlt"
+ else
+ echo "DLT Daemon is NOT running"
+ fi
+
+ if [ -f /var/log/messages ]
+ then
+ echo "------- messages ----------------"
+ cat /var/log/messages | grep -a DLT | tail
+ fi
+
+ if [ -f /var/log/syslog ]
+ then
+ echo "------- SYSLOG -------------------"
+ cat /var/log/syslog | grep -a DLT | tail
+ fi
+ RETVAL=$?
+ ;;
+ *)
+ echo $"Usage: $0 {start|stop|status|restart|condrestart|reload}"
+ ;;
+esac
+
+exit $RETVAL