~loggerhead-team/loggerhead/trunk-rich

« back to all changes in this revision

Viewing changes to loggerhead/daemon.py

  • Committer: Jelmer Vernooij
  • Date: 2008-07-26 14:09:59 UTC
  • mto: This revision was merged to the branch mainline in revision 184.
  • Revision ID: jelmer@samba.org-20080726140959-rxkq2kb69rjdgqe8
Add simple manual pages for loggerhead.

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)
53
52
            pass
54
53
 
55
54
    f = open(pidfile, 'w')
56
 
    f.write('%d\n' % os.getpid())
 
55
    f.write('%d\n' % (os.getpid(),))
 
56
    f.write('%s\n' % (home,))
57
57
    f.close()
58
58
 
59
59