def supervisor_is_running(): import stat try: return stat.S_ISSOCK(os.stat('/tmp/vpnsupervisor.sock').st_mode) except: return False