diff --git a/gestion/lock.py b/gestion/lock.py index 569e86fd..baa360aa 100755 --- a/gestion/lock.py +++ b/gestion/lock.py @@ -77,13 +77,13 @@ def make_lock(lock_name, lock_comment='',nowait=1, quiet=False) : fd.close() # Informations sur le processus lockant - if os.system( "ps %s > /dev/null 2>&1" % pid ) : + if os.system( "ps ax | grep -q '^%s '" % pid ) : # Le script lockant ne tourne plus os.remove(lock_file) elif nowait : if not quiet: sys.stderr.write('Lock : %s\n' % lock_file) - l=getoutput('ps -o etime --no-headers %s' % pid) + l=getoutput("ps -ax -o pid,etime | awk '($1 == %s)'" % pid) data = [ user , pid , l.strip() ] # Formatate de etime