cron problem

"Spruce Weber" <[email protected]> Tue, 07 Jun 2005 08:33:35 -0700
Newsgroups gmane.comp.web.skunkweb
Message-ID <[email protected]>
The python script executed by cron to make sure skunkweb is running
stopped working after I was moved from one server to another.

The script is called restartSkunkWebIfNeeded.py, from
python-hosting.com, and it works when executed from my bash login.

In my config I noticed a sys.path.append referring to a non-existant
"sitelibs" directory directly under my skunkweb installation directory.
Could that be a problem?

The path to my skunkweb installation and document root directories has
not changed on the new server.


restartSkunkWebIfNeeded.py:

#!/usr/local/bin/python2.1

# Check if SkunkWeb is running and restart it if it isn't

import os,sys
skunkHome=os.path.dirname(sys.argv[0])

running=0
try:
        f=open(skunkHome+'/var/run/sw.pid')
        pid=f.readline()
        f.close()
        res=os.popen('ps -aux | grep %s'%pid).readlines()
        for r in res:
                if r.find('grep')==-1: running=1

except IOError: pass

if not running:
        os.system(skunkHome+"/bin/swmgr start")


-------------------------------------------------------
This SF.Net email is sponsored by: NEC IT Guy Games.  How far can you shotput
a projector? How fast can you ride your desk chair down the office luge track?
If you want to score the big prize, get to know the little guy.  
Play to win an NEC 61" plasma display: http://www.necitguy.com/?r=20