diff --git a/mumo.py b/mumo.py index 6824f83..4a8e856 100755 --- a/mumo.py +++ b/mumo.py @@ -533,7 +533,10 @@ if __name__ == '__main__': if option.force_app: raise ImportError # Pretend that we couldn't import the daemon lib import daemon - import daemon.pidlockfile + try: + from daemon.pidfile import TimeoutPIDLockFile + except ImportError: # Version < 1.6 + from daemon.pidlockfile import TimeoutPIDLockFile except ImportError: if option.force_daemon: print >> sys.stderr, 'Fatal error, could not daemonize process due to missing "daemon" library, ' \ @@ -541,7 +544,7 @@ if __name__ == '__main__': sys.exit(1) ret = do_main_program() else: - pidfile = daemon.pidlockfile.TimeoutPIDLockFile(cfg.system.pidfile, 5) + pidfile = TimeoutPIDLockFile(cfg.system.pidfile, 5) if pidfile.is_locked(): try: os.kill(pidfile.read_pid(), 0)