I have had trouble with this, see my earlier mail. And I now think the 
problem is with privileges, and which resource is asking for turbogears 
to start.

I have ended up with a little script which starts several turbogears 
services. This sits in my bin directory and is useable once the boot is 
complete. Since the outputs are going to nohup.out there is no need for 
the terminal after this script is done.

Nigel

On 21 Apr 2006, at 00:00, isaac wrote:

> On 4/20/06, Rune Hansen <[EMAIL PROTECTED]> wrote:
>
>> There's an excellent tool called "lingon" which can be found on
>> http://lingon.sourceforge.net/
>> It'll help you create and operate any launchd service.
>
> Hmm, in the console.log I'm getting a lot of junk about re-spawning
> too quickly, throttling, etc., and the app doesn't start.
>
> I tried a similar utility earlier (don't recall the name, but it
> seemed very half-finished) and got the same result.
>
> 
#!/usr/bin/env python
"""
Automatically restarts the python processes for turbogears applications
"""
import commands, os

# list of services required
servers=[("pathprofiles",8081),
                ("FamilyTree",8088),
         ("support",8092)]

def killProcess(ps):
     s, o = commands.getstatusoutput(ps)
     o = o.split("\n")
     for l1 in o:
         if len(l1)>10:
             l = l1[:5]
             print "killing", l, l1
             s, k = commands.getstatusoutput("kill %s" % l)

# top level directory for turbogears applications
os.chdir("/Users/nigelk/Documents/PythonScripts/turbogears/trunk")

for f, port in servers[:]:
     killProcess("ps -aw | grep %s-start.py | grep -v grep | grep -v 
/sw/bin/tracd" % f)
     # start process using nohup.out as the output terminal
     os.chdir(f)
     print os.spawnlp(os.P_NOWAIT,"/usr/bin/nohup", "/usr/bin/nohup",
                                 "python", "%s-start.py" % f)
     os.chdir("..")
     print "restarting %s on port %s" % (f, port)


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~----------~----~----~----~------~----~------~--~---

Reply via email to