/mandos/trunk

To get this branch, use:
bzr branch http://bzr.recompile.se/loggerhead/mandos/trunk

« back to all changes in this revision

Viewing changes to mandos

  • Committer: Teddy Hogeborn
  • Date: 2008-08-08 23:28:55 UTC
  • mfrom: (24.1.25 mandos)
  • Revision ID: teddy@fukt.bsnet.se-20080808232855-2hcaxr9jwwmvetx4
* Makefile: Do DocBook manual conversion in a better way.

* mandos (main): Write a PID file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
761
761
    
762
762
    if not debug:
763
763
        daemon()
 
764
 
 
765
    pidfilename = "/var/run/mandos/mandos.pid"
 
766
    pid = os.getpid()
 
767
    try:
 
768
        pidfile = open(pidfilename, "w")
 
769
        pidfile.write(str(pid) + "\n")
 
770
        pidfile.close()
 
771
        del pidfile
 
772
    except IOError, err:
 
773
        logger.error("Could not write %s file with PID %d",
 
774
                     pidfilename, os.getpid())
764
775
    
765
776
    def cleanup():
766
777
        "Cleanup function; run on exit"