1
|
#! /bin/bash
|
2
|
#
|
3
|
# larpe Startup script for the Larpe reverse proxy
|
4
|
#
|
5
|
# description: Larpe is Liberty Alliance reverse proxy. It is used to add Liberty Alliance \
|
6
|
# features to some sites without modifying the sites themselves.
|
7
|
# processname: larpe
|
8
|
# config: /etc/httpd/conf.d/larpe.conf
|
9
|
# config: /etc/larpe/apache2-vhost-larpe-common
|
10
|
# config: /etc/sysconfig/larpe
|
11
|
# pidfile: /var/run/larpe.pid
|
12
|
#
|
13
|
|
14
|
### BEGIN INIT INFO
|
15
|
# Provides: larpe
|
16
|
# Required-Start: $local_fs $network
|
17
|
# Required-Stop: $local_fs $network
|
18
|
# Default-Start:
|
19
|
# Default-Stop: 0 1 2 3 4 5 6
|
20
|
# Short-Description: Start Larpe Liberty Alliance reverse proxy
|
21
|
# Description: Start Larpe Liberty Alliance reverse proxy
|
22
|
### END INIT INFO
|
23
|
|
24
|
prog=larpe
|
25
|
LARPECTL=/usr/sbin/larpectl
|
26
|
PIDFILE=/var/run/larpe.pid
|
27
|
|
28
|
# Source function library.
|
29
|
. /etc/rc.d/init.d/functions
|
30
|
|
31
|
# Source networking configuration.
|
32
|
. /etc/sysconfig/network
|
33
|
|
34
|
# Check that networking is up.
|
35
|
[ ${NETWORKING} = "no" ] && exit 0
|
36
|
|
37
|
[ -x $LARPECTL ] || exit 5
|
38
|
|
39
|
# Read config file if it is present.
|
40
|
if [ -f /etc/sysconfig/larpe ]; then
|
41
|
. /etc/sysconfig/larpe
|
42
|
fi
|
43
|
|
44
|
RETVAL=0
|
45
|
|
46
|
#
|
47
|
# Function that starts the daemon/service.
|
48
|
#
|
49
|
start() {
|
50
|
echo -n $"Starting $prog: "
|
51
|
$LARPECTL start &
|
52
|
RETVAL=$?
|
53
|
if [ $RETVAL -eq 0 ]
|
54
|
then
|
55
|
touch /var/lock/subsys/$prog
|
56
|
fi
|
57
|
echo
|
58
|
return $RETVAL
|
59
|
}
|
60
|
|
61
|
#
|
62
|
# Function that stops the daemon/service.
|
63
|
#
|
64
|
stop() {
|
65
|
echo -n $"Stopping $prog: "
|
66
|
killproc $LARPECTL
|
67
|
RETVAL=$?
|
68
|
if [ $RETVAL -eq 0 ]
|
69
|
then
|
70
|
rm -rf /var/lock/subsys/$prog
|
71
|
fi
|
72
|
echo
|
73
|
return $RETVAL
|
74
|
}
|
75
|
|
76
|
# See how we were called.
|
77
|
case "$1" in
|
78
|
start)
|
79
|
start
|
80
|
;;
|
81
|
stop)
|
82
|
stop
|
83
|
;;
|
84
|
status)
|
85
|
status $prog
|
86
|
RETVAL=$?
|
87
|
;;
|
88
|
restart)
|
89
|
stop
|
90
|
start
|
91
|
;;
|
92
|
condrestart)
|
93
|
if [ -f ${PIDFILE} ] ; then
|
94
|
stop
|
95
|
start
|
96
|
fi
|
97
|
;;
|
98
|
*)
|
99
|
echo $"Usage: $prog {start|stop|restart|condrestart|status}"
|
100
|
exit 1
|
101
|
esac
|
102
|
|
103
|
exit $RETVAL
|
104
|
|