Release 2.3.0
[profile/ivi/dlt-daemon.git] / testscripts / dltdaemon
1 #!/bin/sh
2 #
3 # Starts the DLT Daemon
4 #
5 # chkconfig: 2345 21 87
6 # description: Provides DLT Debug Logging & Trace functionality 
7 # processname: dlt-daemon
8
9 # Source function library.
10 . /etc/rc.d/init.d/functions
11
12
13 processname=dlt-daemon
14 processpath=/usr/bin
15 servicename=dlt-daemon
16
17
18 [ -x $processpath ] || exit 0
19
20 start() {
21     echo -n $"Starting $processname daemon: "
22     /usr/bin/dlt-daemon -d
23 }
24
25 stop() {
26     echo -n $"Stopping $processname daemon: "
27     killproc $servicename -TERM
28     RETVAL=$?
29     echo
30     [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$servicename
31 }
32
33 RETVAL=0
34
35 case "$1" in
36     start)
37         start
38         ;;
39     stop)
40         stop
41         ;;
42     restart)
43         stop
44         start
45         ;;
46     condrestart)
47         if [ -f /var/lock/subsys/$servicename ]; then
48             stop
49             start
50         fi
51         ;;
52     reload)
53         restart
54         ;;
55     status)
56         status $processname
57     RETVAL=$?
58         ;;
59     *)
60         echo $"Usage: $0 {start|stop|status|restart|condrestart|reload}"
61         ;;
62 esac
63
64 exit $RETVAL