From 760fb8a4daba3e403376099ce38aca8f88d695d3 Mon Sep 17 00:00:00 2001 From: Christian Muck Date: Mon, 11 Apr 2011 15:41:05 +0200 Subject: Init of dlt daemon --- testscripts/CMakeLists.txt | 40 +++++++++++++++++++++++++++++ testscripts/dltdaemon | 64 ++++++++++++++++++++++++++++++++++++++++++++++ testscripts/dltinfo.sh | 24 +++++++++++++++++ 3 files changed, 128 insertions(+) create mode 100755 testscripts/CMakeLists.txt create mode 100755 testscripts/dltdaemon create mode 100755 testscripts/dltinfo.sh (limited to 'testscripts') diff --git a/testscripts/CMakeLists.txt b/testscripts/CMakeLists.txt new file mode 100755 index 0000000..28e75f7 --- /dev/null +++ b/testscripts/CMakeLists.txt @@ -0,0 +1,40 @@ +####### +# Dlt - Diagnostic Log and Trace +# @licence make begin@ + # + # Copyright (C) 2011, BMW AG - Alexander Wenzel + # + # This program is free software; you can redistribute it and/or modify it under the terms of the + # GNU Lesser General Public License, version 2.1, as published by the Free Software Foundation. + # This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even + # the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General + # Public License, version 2.1, for more details. + # + # You should have received a copy of the GNU Lesser General Public License, version 2.1, along + # with this program; if not, see . + # + # Note that the copyright holders assume that the GNU Lesser General Public License, version 2.1, may + # also be applicable to programs even in cases in which the program is not a library in the technical sense. + # + # Linking DLT statically or dynamically with other modules is making a combined work based on DLT. You may + # license such other modules under the GNU Lesser General Public License, version 2.1. If you do not want to + # license your linked modules under the GNU Lesser General Public License, version 2.1, you + # may use the program under the following exception. + # + # As a special exception, the copyright holders of DLT give you permission to combine DLT + # with software programs or libraries that are released under any license unless such a combination is not + # permitted by the license of such a software program or library. You may copy and distribute such a + # system following the terms of the GNU Lesser General Public License, version 2.1, including this + # special exception, for DLT and the licenses of the other code concerned. + # + # Note that people who make modified versions of DLT are not obligated to grant this special exception + # for their modified versions; it is their choice whether to do so. The GNU Lesser General Public License, + # version 2.1, gives permission to release a modified version without this exception; this exception + # also makes it possible to release a modified version which carries forward this exception. + # + # @licence end@ +######## + +install(PROGRAMS dltdaemon dltinfo.sh + DESTINATION bin + COMPONENT base) diff --git a/testscripts/dltdaemon b/testscripts/dltdaemon new file mode 100755 index 0000000..baf3b8e --- /dev/null +++ b/testscripts/dltdaemon @@ -0,0 +1,64 @@ +#!/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=/usr/bin +servicename=dlt-daemon + + +[ -x $processpath ] || exit 0 + +start() { + echo -n $"Starting $processname daemon: " + /usr/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 + RETVAL=$? + ;; + *) + echo $"Usage: $0 {start|stop|status|restart|condrestart|reload}" + ;; +esac + +exit $RETVAL diff --git a/testscripts/dltinfo.sh b/testscripts/dltinfo.sh new file mode 100755 index 0000000..3e70ab5 --- /dev/null +++ b/testscripts/dltinfo.sh @@ -0,0 +1,24 @@ +#!/bin/sh +clear +processname="dlt-daemon" +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 + -- cgit v1.2.1