Compatibilite avec Nectaris

darcs-hash:20050104160119-d1718-280a6138b0a599c203aecd898bd0dc6a8c840966.gz
This commit is contained in:
bernat 2005-01-04 17:01:19 +01:00
parent 6d0ff951d1
commit 13e14194c9

View file

@ -77,13 +77,13 @@ def make_lock(lock_name, lock_comment='',nowait=1, quiet=False) :
fd.close() fd.close()
# Informations sur le processus lockant # 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 # Le script lockant ne tourne plus
os.remove(lock_file) os.remove(lock_file)
elif nowait : elif nowait :
if not quiet: if not quiet:
sys.stderr.write('Lock : %s\n' % lock_file) 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() ] data = [ user , pid , l.strip() ]
# Formatate de etime # Formatate de etime