source: OpenRLabs-Git/deploy/rlabs-docker/web2py-rlabs/scripts/setup-scheduler-centos.sh @ 42095c5

mainqndtest v1.1.1
Last change on this file since 42095c5 was 42bd667, checked in by David Fuertes <dfuertes@…>, 4 years ago

Historial Limpio

  • Property mode set to 100755
File size: 1.1 KB
Line 
1#!/bin/sh
2#
3# Author: Tyrone Hattingh
4# web2py issue: http://code.google.com/p/web2py/issues/detail?id=867
5#
6# 1) vi web2py-scheduler
7# 2) Paste in the above
8# 3) Add in the following 2 lines in the web2py-scheduler file
9#    (required for centos i believe):
10#
11#  # chkconfig: 2345 90 10
12#  # description: web2py-scheduler
13#
14# 4) make it executable with
15#
16#  chmod 755 web2py-scheduler
17#
18# 5) add it to startup with
19#
20#  chkconfig --add web2py-scheduler
21#
22
23DAEMON=/usr/local/bin/python
24PARAMETERS="/var/www/html/web2py/web2py.py -K init"
25LOGFILE=/var/log/web2py-scheduler.log
26
27start() {
28    echo -n "starting up $DAEMON"
29    RUN=`$DAEMON $PARAMETERS > $LOGFILE 2>&1`
30    if [ "$?" -eq 0 ]; then
31        echo " Done."
32    else
33        echo " FAILED."
34    fi
35}
36stop() {
37    killall $DAEMON
38}
39status() {
40    killall -0 $DAEMON
41    if [ "$?" -eq 0 ]; then
42        echo "Running."
43    else
44        echo "Not Running."
45    fi
46}
47case "$1" in
48    start)
49    start
50    ;;
51    restart)
52    stop
53    sleep 2
54    start
55    ;;
56    stop)
57    stop
58    ;;
59    status)
60    status
61    ;;
62    *)
63    echo "usage : $0 start|restart|stop|status"
64    ;;
65esac
66exit 0
Note: See TracBrowser for help on using the repository browser.