/[projects]/smsdaemon/scripts/smsdaemon-initscript
ViewVC logotype

Contents of /smsdaemon/scripts/smsdaemon-initscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 208 - (show annotations) (download)
Sun Dec 21 18:41:08 2008 UTC (15 years, 5 months ago) by torben
File size: 932 byte(s)
Enable dynamic reload of plugins/tasks when recieving a HUP signal

1 #! /bin/bash
2
3 PIDFILE="/var/run/smsdaemon.pid"
4
5 function start_d
6 {
7 /usr/local/sbin/smsdaemon --daemon
8 }
9
10 function stop_d
11 {
12 if [ -f $PIDFILE ] ; then
13 PID=`cat $PIDFILE`
14 LINES=`ps aux | grep smsdaemon | grep $PID | wc -l`
15 if [ "$LINES" == "1" ] ; then
16 kill $PID
17 else
18 echo "pidfile found -- but smsdaemon not running"
19 fi
20 else
21 echo "PIDFILE not found !!!!!!!!"
22 fi
23 }
24
25 function status_d
26 {
27 if [ -f $PIDFILE ] ; then
28 PID=`cat $PIDFILE`
29 LINES=`ps aux | grep smsdaemon | grep $PID | wc -l`
30 if [ "$LINES" == "1" ] ; then
31 echo "smsdaemon running (pid=$PID)"
32 else
33 echo "pidfile found -- but smsdaemon not running"
34 fi
35 else
36 echo "no pidfile - smsdaemon not started"
37 fi
38 }
39
40 function reload_d
41 {
42 PID=`cat $PIDFILE`
43 kill -HUP $PID
44 }
45
46 case $1 in
47 "start")
48 start_d
49 ;;
50 "stop")
51 stop_d
52 ;;
53 "status")
54 status_d
55 ;;
56 "reload")
57 reload_d
58 ;;
59 *)
60 echo "Usage $0 [start|stop|status|reload]"
61 ;;
62 esac

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.20