-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvsys-initscript
More file actions
executable file
·56 lines (49 loc) · 1.13 KB
/
Copy pathvsys-initscript
File metadata and controls
executable file
·56 lines (49 loc) · 1.13 KB
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
#!/bin/bash
#
# chkconfig: 345 84 02
# description: Vsys file descriptor abritrator startup.
#
# Sapan Bhatia <sapanb@cs.princeton.edu>
#
# $Id$
# $HeadURL$
#
name="vsys"
# Source function library.
. /etc/rc.d/init.d/functions
if [ -f /etc/sysconfig/$name ]; then
. /etc/sysconfig/$name
fi
backend=${BACKEND-/vsys}
conf=${CONF-/etc/$name.conf}
pidfile=${PIDFILE-/var/run/$name.pid}
lockfile=${LOCKFILE-/var/lock/subsys/$name}
RETVAL=0
vsys=${VSYS- "/usr/bin/vsys -failsafe -backend $backend -conffile $conf -daemon"}
case "$1" in
start)
echo -n "Starting $name:"
if [ ! -d $backend ]; then mkdir $backend; fi
daemon --check=vsys $vsys
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch ${lockfile}
;;
stop)
echo -n "Stopping $name:"
killproc $name
#killproc $name - Why were there 2 instances of this? :-|
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f ${lockfile} ${pidfile}
;;
restart)
$0 stop
$0 start
RETVAL=$?
;;
*)
echo $"Usage: $0 {start|stop|restart}"
exit 1
;;
esac