| Line 16... |
Line 16... |
| 16 |
|
16 |
|
| 17 |
# Do NOT "set -e"
|
17 |
# Do NOT "set -e"
|
| 18 |
|
18 |
|
| 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="/usr/local/lib/python2.6/dist-packages/PyProj-0.1-py2.6.egg"
|
| 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
|
22 |
export PYTHONPATH=${PROJECT_DIR}:/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="Logistics server used by the saholic.com website"
|
23 |
DESC="Logistics server used by the saholic.com website"
|
| 25 |
NAME="logistics-server"
|
24 |
NAME="logistics-server"
|
| 26 |
PIDFILE=/var/run/$NAME.pid
|
25 |
PIDFILE=/var/run/$NAME.pid
|
| 27 |
DAEMON=/usr/bin/python2.6
|
26 |
DAEMON=/usr/bin/python2.6
|
| 28 |
SCRIPTNAME=/etc/init.d/$NAME
|
27 |
SCRIPTNAME=/etc/init.d/$NAME
|
| Line 47... |
Line 46... |
| 47 |
{
|
46 |
{
|
| 48 |
# Return
|
47 |
# Return
|
| 49 |
# 0 if daemon has been started
|
48 |
# 0 if daemon has been started
|
| 50 |
# 1 if daemon was already running
|
49 |
# 1 if daemon was already running
|
| 51 |
# 2 if daemon could not be started
|
50 |
# 2 if daemon could not be started
|
| 52 |
$DAEMON -u ${PROJECT_DIR}/PyProj/src/shop2020/logistics/service/LogisticsServer.py -l /var/log/services/logistics.log -i $PIDFILE start
|
51 |
$DAEMON -u ${PROJECT_DIR}/shop2020/logistics/service/LogisticsServer.py -l /var/log/services/logistics.log -i $PIDFILE start
|
| 53 |
# Add code here, if necessary, that waits for the process to be ready
|
52 |
# Add code here, if necessary, that waits for the process to be ready
|
| 54 |
# to handle requests from services started subsequently which depend
|
53 |
# to handle requests from services started subsequently which depend
|
| 55 |
# on this one. As a last resort, sleep for some time.
|
54 |
# on this one. As a last resort, sleep for some time.
|
| 56 |
}
|
55 |
}
|
| 57 |
|
56 |
|
| Line 63... |
Line 62... |
| 63 |
# Return
|
62 |
# Return
|
| 64 |
# 0 if daemon has been stopped
|
63 |
# 0 if daemon has been stopped
|
| 65 |
# 1 if daemon was already stopped
|
64 |
# 1 if daemon was already stopped
|
| 66 |
# 2 if daemon could not be stopped
|
65 |
# 2 if daemon could not be stopped
|
| 67 |
# other if a failure occurred
|
66 |
# other if a failure occurred
|
| 68 |
$DAEMON -u ${PROJECT_DIR}/PyProj/src/shop2020/logistics/service/LogisticsServer.py -l /var/log/services/logistics.log -i $PIDFILE stop
|
67 |
$DAEMON -u ${PROJECT_DIR}/shop2020/logistics/service/LogisticsServer.py -l /var/log/services/logistics.log -i $PIDFILE stop
|
| 69 |
RETVAL="$?"
|
68 |
RETVAL="$?"
|
| 70 |
[ "$RETVAL" = 1 ] && return 2
|
69 |
[ "$RETVAL" = 1 ] && return 2
|
| 71 |
# Wait for children to finish too if this is a daemon that forks
|
70 |
# 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.
|
71 |
# and if the daemon is only ever run from this initscript.
|
| 73 |
# If the above conditions are not satisfied then add some other code
|
72 |
# If the above conditions are not satisfied then add some other code
|