I made web2py autostart on a mac osx server conforming to
tutorial<http://docstore.mik.ua/orelly/unix3/mac/ch02_02.htm>
.
Install web2py in /Applications folder.
The StartupParameters.plist must be placed in the /Library/StartupItems/ (if
you don't have one already).
Then create a directory named web2py in the same location
(/Library/StartupItems/) and place the web2py shell file in it.
Make web2py file executable like this: chmod
+x /Library/StartupItems/web2py/web2py
You can use the following command now:
sudo /Library/StartupItems/web2py/web2py start
sudo /Library/StartupItems/web2py/web2py restart
sudo /Library/StartupItems/web2py/web2py stop
The autostart feature is not tested as I created them on a production server
and I cannot restart it.
StartupParameters.plist:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist SYSTEM
"file://localhost/System/Library/DTDs/PropertyList.dtd"> <plist
version="0.9"> <dict> <key>Description</key> <string>web2py</string>
<key>Provides</key> <array> <string>web2py</string> </array>
<key>Requires</key> <array> <string>Network</string> </array>
<key>OrderPreference</key> <string>Late</string> </dict> </plist>
web2py:
#!/bin/sh . /etc/rc.common StartService( ) { ConsoleMessage "Starting
web2py" /Applications/web2py.app/Contents/MacOS/web2py -a "<recycle>" -i
0.0.0.0 -p 8000 -d /var/run/web2py.pid & } StopService( ) { ConsoleMessage
"Stopping web2py" kill `cat /var/run/web2py.pid` } RestartService( ) {
ConsoleMessage "Restarting web2py" StopService StartService } RunService
"$1"