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