From 13e14194c938135e83e5dda6dc1dd3bd2dc64218 Mon Sep 17 00:00:00 2001 From: bernat Date: Tue, 4 Jan 2005 17:01:19 +0100 Subject: [PATCH] Compatibilite avec Nectaris darcs-hash:20050104160119-d1718-280a6138b0a599c203aecd898bd0dc6a8c840966.gz --- gestion/lock.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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