1
0
Fork 0
mirror of https://github.com/yweber/lodel2.git synced 2025-10-25 18:29:02 +02: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
#@return bool
def is_running(name, pid):
try:
os.kill(pid, 0)
return True
except (OSError,ProcessLookupError):
pid_datas = get_pids()
logging.warning("Instance '%s' was marked as running, but not \
process with pid %d found. Cleaning pid list" % (name, pid))
del(pid_datas[name])
save_pids(pid_datas)
return False
def is_running(name):
if name is None:
return LodelContext._current is not None
else:
if LodelContext._type == LodelContext.MONOSITE
logging.warning("In monosite mode no name is allowed")
else:
return LodelContext.__current == LodelContext._contexts[name]
##@brief Check if instance are specified
def get_specified(args):