1
0
Fork 0
mirror of https://github.com/yweber/lodel2.git synced 2026-03-25 04:22:02 +01:00

Changes to slim for LodelContext - corrects is_running

This commit is contained in:
prieto 2016-11-03 15:25:17 +01:00
commit ec0208a0aa

View file

@ -286,18 +286,14 @@ with pid %d found" % (name, pids[name]))
# #
#If not running clean the pid list #If not running clean the pid list
#@return bool #@return bool
def is_running(name, pid): def is_running(name):
try: if name is None:
os.kill(pid, 0) return LodelContext._current is not None
return True else:
except (OSError,ProcessLookupError): if LodelContext._type == LodelContext.MONOSITE
pid_datas = get_pids() logging.warning("In monosite mode no name is allowed")
logging.warning("Instance '%s' was marked as running, but not \ else:
process with pid %d found. Cleaning pid list" % (name, pid)) return LodelContext.__current == LodelContext._contexts[name]
del(pid_datas[name])
save_pids(pid_datas)
return False
##@brief Check if instance are specified ##@brief Check if instance are specified
def get_specified(args): def get_specified(args):