def shutdown(restart=False, update=False): cherrypy.engine.exit() SCHED.shutdown(wait=False) CONFIG.write() if not restart and not update: logger.info('Headphones is shutting down...') if update: logger.info('Headphones is updating...') try: versioncheck.update() except Exception as e: logger.warn('Headphones failed to update: %s. Restarting.', e) if CREATEPID: logger.info('Removing pidfile %s', PIDFILE) os.remove(PIDFILE) if restart: logger.info('Headphones is restarting...') popen_list = [sys.executable, FULL_PATH] popen_list += ARGS if '--nolaunch' not in popen_list: popen_list += ['--nolaunch'] logger.info('Restarting Headphones with %s', popen_list) subprocess.Popen(popen_list, cwd=os.getcwd()) os._exit(0)
def shutdown(restart=False, update=False): cherrypy.engine.exit() SCHED.shutdown(wait=False) config_write() if update: try: versioncheck.update() except Exception, e: logger.warn('Headphones failed to update: %s. Restarting.' % e)
def shutdown(restart=False, update=False): cherrypy.engine.exit() SCHED.shutdown(wait=False) config_write() if not restart and not update: logger.info("Headphones is shutting down...") if update: logger.info("Headphones is updating...") try: versioncheck.update() except Exception, e: logger.warn("Headphones failed to update: %s. Restarting." % e)
def shutdown(restart=False, update=False): cherrypy.engine.exit() SCHED.shutdown(wait=False) config_write() if not restart and not update: logger.info('Headphones is shutting down...') if update: logger.info('Headphones is updating...') try: versioncheck.update() except Exception, e: logger.warn('Headphones failed to update: %s. Restarting.' % e)