Commit df71e864 authored by Vitaly Lipatov's avatar Vitaly Lipatov

rewrite check_locking according to new hasher locking method

parent 7f9f8303
#!/bin/bash #!/bin/bash
# 2008 Etersoft www.etersoft.ru # 2008, 2010 Etersoft www.etersoft.ru
# Author: Vitaly Lipatov <lav@etersoft.ru> # Author: Vitaly Lipatov <lav@etersoft.ru>
# Public domain # Public domain
. $ETERBUILDDIR/functions/rpm load_mod rpm
check_locking() check_locking()
{ {
if [ -f $HASHERDIR/lockdir/lockfile ] test -f "$HASHERDIR/pid" || return
then local pid="$(cat "$HASHERDIR/pid")"
echo if [ "$pid" -gt 0 ] ; then
echog "Hasher $HASHERDIR in use at `date`" if kill -0 -- "$pid" 2>/dev/null; then
echo -n "Wait for unlocking" warning "hasher dir $HASHERDIR is already locked by pid $pid"
while test -f $HASHERDIR/lockdir/lockfile ps hp "$pid" >&2
do else
echo -n "." warning "hasher dir $HASHERDIR is locked by stale pid $pid"
sleep $(($RANDOM%5+3)) fi
done
echo
fi fi
# echo -n "Wait for unlocking"
# while test -f $HASHERDIR/lockdir/lockfile
# do
# echo -n "."
# sleep $(($RANDOM%5+3))
# done
} }
# workaround about hard coded path to sources.list in apt.conf # workaround about hard coded path to sources.list in apt.conf
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment