(pidfile, sig)
return False
Send a signal to process whose ID is located in pidfile.

    Read only first line of pidfile to support multiline
    pidfiles like postmaster.pid.

    Returns True is successful, False if pidfile does not exist
    or process itself is dead.  Any other errors will passed
    as exceptions.
Send a signal to process whose ID is located in pidfile.
Send a signal to process whose ID is located in pidfile .
def signal_pidfile(pidfile, sig):
    """Send a signal to process whose ID is located in pidfile.

    Read only first line of pidfile to support multiline
    pidfiles like postmaster.pid.

    Returns True is successful, False if pidfile does not exist
    or process itself is dead.  Any other errors will passed
    as exceptions."""

    ln = ''
    try:
        f = open(pidfile, 'r')
        ln = f.readline().strip()
        f.close()
        pid = int(ln)
        if sig == 0 and sys.platform == 'win32':
            return win32_detect_pid(pid)
        os.kill(pid, sig)
        return True
    except IOError, ex:
        if ex.errno != errno.ENOENT:
            raise
    except OSError, ex:
        if ex.errno != errno.ESRCH:
            raise
    except ValueError, ex:
        # this leaves slight race when someone is just creating the file,
        # but more common case is old empty file.
        if not ln:
            return False
        raise ValueError('Corrupt pidfile: %s' % pidfile)
    return False
def signal_pidfile ( pidfile , sig ) : ln = '' try : f = open ( pidfile , 'r' ) ln = f . readline ( ) . strip ( ) f . close ( ) pid = int ( ln ) if sig == 0 and sys . platform == 'win32' : return win32_detect_pid ( pid ) os . kill ( pid , sig ) return True except IOError , ex : if ex . errno != errno . ENOENT : raise except OSError , ex : if ex . errno != errno . ESRCH : raise except ValueError , ex : # this leaves slight race when someone is just creating the file, # but more common case is old empty file. if not ln : return False raise ValueError ( 'Corrupt pidfile: %s' % pidfile ) return False