just test to create the service for web2py that running from source, 
status worked (start, stop and restart), pls change the path with your 
web2py path:
e.g. 
touch ~/Downloads/web2py
chmod +x ~/Downloads/web2py
vi  ~/Downloads/web2py

#!/bin/sh
. /etc/rc.common

StartService( )
{
ConsoleMessage "Starting web2py"
python /path/web2py/web2py.py --nogui --no-banner -a 'a' -i 0.0.0.0 -p 8000 
-d /path/web2py/web2py.pid &
}

StopService( )
{
ConsoleMessage "Stopping web2py"
kill `cat /path/web2py/web2py.pid`
}

RestartService( )
{
ConsoleMessage "Restarting web2py"
StopService
StartService
}

RunService "$1"

n.b.
- source /path/bin/activate do not work when using virtual environment, 
error : /path/bin/activate: line 58: PS1: unbound variable
- if you prefer to put *.pid file in /var/run or other folder that need 
root privilege pls ensure the user have a root privilege (sudo)

best regards,
stifan

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to