File: init.d_roxen

package info (click to toggle)
roxen 1.2beta2-2
  • links: PTS
  • area: contrib
  • in suites: hamm
  • size: 16,948 kB
  • ctags: 8,589
  • sloc: ansic: 89,632; asm: 8,431; sh: 2,915; makefile: 1,787; cpp: 377
file content (58 lines) | stat: -rwxr-xr-x 1,364 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/sh
# init.d script for Roxen. Set the variables below to something fitting..
# This is only an example script.
#############
roxenhome=/usr/local/roxen/server/
wwwuser=www
killallwww=yes
# ':0' should be the uid.
pidfile=/tmp/roxen_pid:0

# If you want to start with another configuration directory:
#configdir=dirname

### You should not _have_ to change anything below here...

case $1 in
	'start_msg')
	  echo 'Start Roxen 1.2'
	  exit 0
	;;
	'stop_msg')
	  echo 'Stop Roxen 1.2'
	  exit 0
	;;
	'start')
          echo Starting Roxen...
	  if [ -x $roxenhome/start ]; then
 	    cd $roxenhome
	    if [ \! "$configdir" = "" ]; then
	      ./start --config-dir=$configdir 2>/dev/null
	    else
	      ./start 2>/dev/null
	    fi
          else
            echo I cannot find the Roxen dir '('$roxenhome')'
	  fi
          echo Done.
	;;

	*)
           echo Stopping Roxen...
	   if [ -f $pidfile ] ; then
             kill -USR1 `cat $pidfile` 2>/dev/null
             sleep 4
             kill `cat $pidfile` 2>/dev/null
             sleep 1
             kill -9 `cat $pidfile` 2>/dev/null
           fi
           # Get all the CGI scripts... :-)
           if [ x$killallwww = xyes ] ; then
	     echo Killing all programs running as the www user.
             su $wwwuser -c "kill -9 -1"
           fi
           echo Roxen stopped.
	;;
esac

exit 0