Maybe this should go into the docs somewhere. Maybe the scheduler docstring 
next to the upstart script? Maybe post an issue on google code to update the 
docs? http://code.google.com/p/web2py/issues/list

On Jun 28, 2012, at 5:41 AM, Tyrone wrote:

> Hi Guys,
> 
> Although this script works great when upstart is available, when upstart is 
> not available you can't do it like this. I struggled to find a solution on 
> here or anywhere online, so I have made an alternative script which will work 
> on sysvinit (/etc/init.d)
> 
> #!/bin/sh
> 
> DAEMON=/usr/local/bin/python
> PARAMETERS="/var/www/html/web2py/web2py.py -K init"
> LOGFILE=/var/log/web2py-scheduler.log
> 
> start() {
>     echo -n "starting up $DAEMON"
>     RUN=`$DAEMON $PARAMETERS > $LOGFILE 2>&1`
>     if [ "$?" -eq 0 ]; then
>         echo " Done."
>     else
>         echo " FAILED."
>     fi
> }
> stop() {
>     killall $DAEMON
> }
> status() {
>     killall -0 $DAEMON
>     if [ "$?" -eq 0 ]; then
>         echo "Running."
>     else
>         echo "Not Running."
>     fi
> }
> case "$1" in
>     start)
>     start
>     ;;
>     restart)
>     stop
>     sleep 2
>     start
>     ;;
>     stop)
>     stop
>     ;;
>     status)
>     status
>     ;;
>     *)
>     echo "usage : $0 start|restart|stop|status"
>     ;;
> esac
> exit 0
> 
> I installed this on CentOS release 5.5, however I needed to follow these 
> instructions to install:
> 
> 1.) # vi web2py-scheduler
> 2.) Paste in the above
> 3.) Add in the following 2 lines in the web2py-scheduler file (required for 
> centos i believe):
> 
> # chkconfig: 2345 90 10
> # description: web2py-scheduler
> 
> 4.) make it executable # chmod 755 web2py-scheduler
> 5.) add it to startup # chkconfig --add web2py-scheduler

Reply via email to