[Pythonmac-SIG] webkit cgi build and startupitems problems

Samuel M.Smith smithsm at samuelsmith.org
Mon Oct 4 22:04:52 CEST 2004


> I'm pretty sure you need a new version of wkcommon.h, which you can  
> get from:
>
> http://cvs.sourceforge.net/viewcvs.py/webware/Webware/WebKit/Adapters/ 
> common/
>

that fixed it. Thanks,


>> Has anybody figured out how to have webkit appserver startup  
>> automatically in os x 10.3.5?
>
> sorry I haven't got that far yet!
>
Well I found a tutuorial online for making startupitems for os X
http://osxfaq.1dot1.com/Tutorials/LearningCenter/OSXTutorials/Startup/ 
index.ws

Based on that I came up with something that works


everthing has to be owned by root so either sudo or do it as root

make a directory in /library/startupitems
call it whatever you want
I called mine WebkitAppserver
make two files inside the directory WebkitAppserver
both must be owned by root
first file must be named the same as the directory in this case  
WebkitAppserver
it must have ugo+rx permissions

the second file must be named StartupParameters.plist
I am not sure what permissions it should have but ugo+rx works

put the following into the file WebkitAppserver. Put the path to where  
you have
Appserver stored in the two cd lines

#! /bin/sh

. /etc/rc.common

StartService ()
{
	ConsoleMessage "Starting Webkit Appserver"
	#change directory to where the Appserver lives
    	cd /users/webware/webware81/webkit
      ./Appserver >> /var/log/webkit 2>&1 &
}

StopService ()
{
    	ConsoleMessage "Stopping Webkit Appserver"
	#change directory to where the Appserver lives
  	cd /users/webware/webware81/webkit
    ./Appserver stop >> /var/log/webkit 2>&1
}

RestartService ()
{
    ConsoleMessage "Reloading Webkit Appserver"
    StopService;
    StartService;
}

RunService "$1"


Now put the following into the file
StartupParameters.plist

{
   Description   = "Webkit Appserver";
   Provides      = ("Webkit");
   Requires      = ("Resolver");
   Uses          = ("Network Time", "httpd");
   OrderPreference    = "Last";
   Messages =
   {
     start = "Starting Webkit Appserver";
     stop  = "Stopping Webkit Appserver";
     restart  = "Reloading Webkit Appserver";
   };
}


I don't know if it matters what is in the Uses line but Network Time  
was in another example and I thought
httpd should be there.

Anyway it works.

to test
->cd /library/startupitems/webkitappserver
->sudo webkitappserver start




More information about the Pythonmac-SIG mailing list