/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-09-13 15:36:18 UTC
  • Revision ID: teddy@fukt.bsnet.se-20080913153618-atp386q2bqj0ku99
* Makefile (install-client-nokey): Do "&&" instead of ";" to catch
                                   errors.

* README: Kill the straight quotes.  Add copyright notice.

* overview.xml: Improved wording.

Show diffs side-by-side

added added

removed removed

Lines of Context:
772
772
                                tcp_handler,
773
773
                                settings=server_settings,
774
774
                                clients=clients)
 
775
    pidfilename = "/var/run/mandos.pid"
 
776
    try:
 
777
        pidfile = open(pidfilename, "w")
 
778
    except IOError, error:
 
779
        logger.error("Could not open file %r", pidfilename)
 
780
    
775
781
    uid = 65534
776
782
    gid = 65534
777
783
    try:
794
800
    except OSError, error:
795
801
        if error[0] != errno.EPERM:
796
802
            raise error
797
 
 
 
803
    
798
804
    global service
799
805
    service = AvahiService(name = server_settings["servicename"],
800
806
                           type = "_mandos._tcp", );
841
847
        # Close all input and output, do double fork, etc.
842
848
        daemon()
843
849
    
844
 
    pidfilename = "/var/run/mandos.pid"
845
 
    pid = os.getpid()
846
850
    try:
847
 
        pidfile = open(pidfilename, "w")
 
851
        pid = os.getpid()
848
852
        pidfile.write(str(pid) + "\n")
849
853
        pidfile.close()
850
854
        del pidfile
851
855
    except IOError, err:
852
 
        logger.error(u"Could not write %s file with PID %d",
853
 
                     pidfilename, os.getpid())
 
856
        logger.error(u"Could not write to file %r with PID %d",
 
857
                     pidfilename, pid)
 
858
    except NameError:
 
859
        # "pidfile" was never created
 
860
        pass
 
861
    del pidfilename
854
862
    
855
863
    def cleanup():
856
864
        "Cleanup function; run on exit"