~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to loggerhead/daemon.py

  • Committer: Michael Hudson
  • Date: 2008-06-16 23:23:46 UTC
  • mto: This revision was merged to the branch mainline in revision 164.
  • Revision ID: michael.hudson@canonical.com-20080616232346-28gahg0hkanulvao
oops

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# daemon code from ASPN
2
 
#
3
2
 
4
3
import os
5
4
 
25
24
        try:
26
25
            pid = os.fork()     # Fork a second child.
27
26
        except OSError, e:
28
 
            raise Exception("%s [%d]" % (e.strerror, e.errno))
 
27
            raise Exception, "%s [%d]" % (e.strerror, e.errno)
29
28
 
30
29
        if pid == 0:  # The second child.
31
30
            os.chdir(WORKDIR)
54
53
 
55
54
    f = open(pidfile, 'w')
56
55
    f.write('%d\n' % (os.getpid(),))
 
56
    f.write('%s\n' % (home,))
57
57
    f.close()
58
58
 
59
59