| Line 19... |
Line 19... |
| 19 |
# PATH should only include /usr/* if it runs after the mountnfs.sh script
|
19 |
# PATH should only include /usr/* if it runs after the mountnfs.sh script
|
| 20 |
PATH=/sbin:/usr/sbin:/bin:/usr/bin
|
20 |
PATH=/sbin:/usr/sbin:/bin:/usr/bin
|
| 21 |
PROJECT_DIR="/root/code/trunk"
|
21 |
PROJECT_DIR="/root/code/trunk"
|
| 22 |
LOGDIR="${PROJECT_DIR}/runutils"
|
22 |
LOGDIR="${PROJECT_DIR}/runutils"
|
| 23 |
export PYTHONPATH=${PROJECT_DIR}/PyProj/src:${PROJECT_DIR}/ThriftConfigPy/src:/usr/lib/pymodules/python2.6:/usr/lib/pymodules/python2.6/gtk-2.0:/usr/lib/python2.6:/usr/lib/python2.6/dist-packages:/usr/lib/python2.6/dist-packages/PIL:/usr/lib/python2.6/dist-packages/gst-0.10:/usr/lib/python2.6/dist-packages/gtk-2.0:/usr/lib/python2.6/lib-dynload:/usr/lib/python2.6/lib-old:/usr/lib/python2.6/lib-tk:/usr/lib/python2.6/plat-linux2:/usr/local/lib/python2.6/dist-packages:/usr/local/lib/python2.6/dist-packages/Elixir-0.7.1-py2.6.egg:/usr/local/lib/python2.6/dist-packages/TracXMLRPC-0.1-py2.6.egg:/usr/local/lib/python2.6/dist-packages/tornado-1.0.1-py2.6.egg
|
23 |
export PYTHONPATH=${PROJECT_DIR}/PyProj/src:${PROJECT_DIR}/ThriftConfigPy/src:/usr/lib/pymodules/python2.6:/usr/lib/pymodules/python2.6/gtk-2.0:/usr/lib/python2.6:/usr/lib/python2.6/dist-packages:/usr/lib/python2.6/dist-packages/PIL:/usr/lib/python2.6/dist-packages/gst-0.10:/usr/lib/python2.6/dist-packages/gtk-2.0:/usr/lib/python2.6/lib-dynload:/usr/lib/python2.6/lib-old:/usr/lib/python2.6/lib-tk:/usr/lib/python2.6/plat-linux2:/usr/local/lib/python2.6/dist-packages:/usr/local/lib/python2.6/dist-packages/Elixir-0.7.1-py2.6.egg:/usr/local/lib/python2.6/dist-packages/TracXMLRPC-0.1-py2.6.egg:/usr/local/lib/python2.6/dist-packages/tornado-1.0.1-py2.6.egg
|
| 24 |
DESC="Warehouse server used by the saholic.com website"
|
24 |
DESC="Purchase server used by the saholic.com website"
|
| 25 |
NAME="warehouse-server"
|
25 |
NAME="purchase-server"
|
| 26 |
PIDFILE=/var/run/$NAME.pid
|
26 |
PIDFILE=/var/run/$NAME.pid
|
| 27 |
DAEMON=/usr/bin/python2.6
|
27 |
DAEMON=/usr/bin/python2.6
|
| 28 |
SCRIPTNAME=/etc/init.d/$NAME
|
28 |
SCRIPTNAME=/etc/init.d/$NAME
|
| 29 |
|
29 |
|
| 30 |
# Exit if the package is not installed
|
30 |
# Exit if the package is not installed
|
| Line 47... |
Line 47... |
| 47 |
{
|
47 |
{
|
| 48 |
# Return
|
48 |
# Return
|
| 49 |
# 0 if daemon has been started
|
49 |
# 0 if daemon has been started
|
| 50 |
# 1 if daemon was already running
|
50 |
# 1 if daemon was already running
|
| 51 |
# 2 if daemon could not be started
|
51 |
# 2 if daemon could not be started
|
| 52 |
$DAEMON -u ${PROJECT_DIR}/PyProj/src/shop2020/warehouse/main/WarehouseServer.py -l /var/log/services/warehouse.log -i $PIDFILE start
|
52 |
$DAEMON -u ${PROJECT_DIR}/PyProj/src/shop2020/purchase/main/PurchaseServer.py -l /var/log/services/purchase.log -i $PIDFILE start
|
| 53 |
# Add code here, if necessary, that waits for the process to be ready
|
53 |
# Add code here, if necessary, that waits for the process to be ready
|
| 54 |
# to handle requests from services started subsequently which depend
|
54 |
# to handle requests from services started subsequently which depend
|
| 55 |
# on this one. As a last resort, sleep for some time.
|
55 |
# on this one. As a last resort, sleep for some time.
|
| 56 |
}
|
56 |
}
|
| 57 |
|
57 |
|
| Line 63... |
Line 63... |
| 63 |
# Return
|
63 |
# Return
|
| 64 |
# 0 if daemon has been stopped
|
64 |
# 0 if daemon has been stopped
|
| 65 |
# 1 if daemon was already stopped
|
65 |
# 1 if daemon was already stopped
|
| 66 |
# 2 if daemon could not be stopped
|
66 |
# 2 if daemon could not be stopped
|
| 67 |
# other if a failure occurred
|
67 |
# other if a failure occurred
|
| 68 |
$DAEMON -u ${PROJECT_DIR}/PyProj/src/shop2020/warehouse/main/WarehouseServer.py -l /var/log/services/warehouse.log -i $PIDFILE stop
|
68 |
$DAEMON -u ${PROJECT_DIR}/PyProj/src/shop2020/purchase/main/PurchaseServer.py -l /var/log/services/purchase.log -i $PIDFILE stop
|
| 69 |
RETVAL="$?"
|
69 |
RETVAL="$?"
|
| 70 |
[ "$RETVAL" = 1 ] && return 2
|
70 |
[ "$RETVAL" = 1 ] && return 2
|
| 71 |
# Wait for children to finish too if this is a daemon that forks
|
71 |
# Wait for children to finish too if this is a daemon that forks
|
| 72 |
# and if the daemon is only ever run from this initscript.
|
72 |
# and if the daemon is only ever run from this initscript.
|
| 73 |
# If the above conditions are not satisfied then add some other code
|
73 |
# If the above conditions are not satisfied then add some other code
|