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:
parent
50560c8496
commit
ec0208a0aa
1 changed files with 8 additions and 12 deletions
|
|
@ -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):
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue