283.1.86
by NOMURA Yoshihide
create service script for controller. |
1 |
#!/bin/sh
|
2 |
# /etc/init.d/appscale-controller
|
|
3 |
# Chris Bunch
|
|
4 |
### BEGIN INIT INFO
|
|
5 |
# Provides: appscale
|
|
6 |
# Required-Start: $network
|
|
7 |
# Required-Stop:
|
|
8 |
# Default-Start: 2 3 4 5
|
|
9 |
# Default-Stop: 0 1 6
|
|
10 |
# Short-Description: AppScale Controller service
|
|
11 |
# Description: AppScale Controller service
|
|
12 |
### END INIT INFO
|
|
13 |
||
14 |
. /etc/profile |
|
15 |
. /lib/lsb/init-functions |
|
16 |
||
17 |
RUBY=/usr/bin/ruby |
|
18 |
#RUBY=/usr/bin/jruby
|
|
19 |
PNAME=AppController |
|
20 |
PID=/tmp/djinn.pid |
|
21 |
||
22 |
case "$1" in |
|
23 |
start)
|
|
24 |
log_begin_msg "Starting AppScale Controller.."
|
|
283.1.88
by NOMURA Yoshihide
fix djinnServer path. |
25 |
# start-stop-daemon --start --background --pidfile ${PID} --name ${PNAME} --exec ${RUBY} -- ${APPSCALE_HOME}/AppController/djinnServer.rb
|
26 |
${RUBY} ${APPSCALE_HOME}/AppController/djinnServer.rb & |
|
283.1.86
by NOMURA Yoshihide
create service script for controller. |
27 |
log_end_msg 0
|
28 |
;;
|
|
29 |
stop)
|
|
30 |
log_begin_msg "Stopping AppScale Controller.."
|
|
31 |
${RUBY} ${APPSCALE_HOME}/AppController/terminate.rb |
|
32 |
# start-stop-daemon --stop --name ${PNAME} --pidfile ${PID}
|
|
33 |
log_end_msg 0
|
|
34 |
;;
|
|
35 |
*)
|
|
36 |
echo "Usage: /etc/init.d/appscale-controller {start|stop}" |
|
37 |
exit 1 |
|
38 |
;;
|
|
39 |
esac
|