b9042c
#!/bin/bash
b9042c
b9042c
if [ -e /etc/sysconfig/man-db ]; then
b9042c
    . /etc/sysconfig/man-db
b9042c
fi
b9042c
b9042c
if [ "$CRON" = "no" ]; then
b9042c
   exit 0
b9042c
fi
b9042c
b9042c
renice +19 -p $$ >/dev/null 2>&1
b9042c
ionice -c3 -p $$ >/dev/null 2>&1
b9042c
b9042c
LOCKFILE=/var/lock/man-db.lock
b9042c
b9042c
# the lockfile is not meant to be perfect, it's just in case the
b9042c
# two man-db cron scripts get run close to each other to keep
b9042c
# them from stepping on each other's toes.  The worst that will
b9042c
# happen is that they will temporarily corrupt the database
b9042c
[[ -f $LOCKFILE ]] && exit 0
b9042c
b9042c
trap "{ rm -f $LOCKFILE ; exit 0; }" EXIT
b9042c
touch $LOCKFILE
b9042c
# create/update the mandb database
b9042c
mandb $OPTS
b9042c
b9042c
exit 0