def write_pid(pid_file):
    """Write out the current PID"""

    try:
        pidfd = open(pid_file, 'w')
    except __HOLE__, ex:
        log.error("Failed to open PID file %s" % pid_file)
        log.error("Error: %s" % (ex,))
        sys.exit(1)

    pidfd.write("%s\n" % os.getpid())
    pidfd.close()
dataset/ETHPy150Open marineam/nagcat/python/nagcat/util.py/write_pid