~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to loggerhead/daemon.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-09-10 17:30:17 UTC
  • mfrom: (138.1.1 mwhudson-sucks)
  • Revision ID: pqm@pqm.ubuntu.com-20070910173017-teattztsb8ep0aer
[trivial] so i cleaned up the tests, but also broke them :( need to look at getting PQM to run the loggerhead tests...

Show diffs side-by-side

added added

removed removed

Lines of Context:
60
60
    f.write('%d\n' % (os.getpid(),))
61
61
    f.write('%s\n' % (home,))
62
62
    f.close()
 
63
 
 
64
 
 
65
def is_running(pidfile):
 
66
    try:
 
67
        f = open(pidfile, 'r')
 
68
    except IOError:
 
69
        return False
 
70
    pid = int(f.readline())
 
71
    f.close()
 
72
    try:
 
73
        os.kill(pid, 0)
 
74
    except OSError:
 
75
        # no such process
 
76
        return False
 
77
    return True