When I merged the new config files I noticed two errors in the cron script: 1) When /etc/updatedb.conf is missing the ARGS for /usr/bin/updatedb are invalid (the list for -f must be passed as a single argument). I renamed /etc/updatedb.conf to test it and got: /usr/bin/updatedb: unexpected operand on command line There are several ways you could fix it: (a) Quote the list and use eval, i.e., replace ARGS="-f ${nodevs}" on line 32 with ARGS="-f '${nodevs}'" and /usr/bin/updatedb ${ARGS} on line 45 with eval /usr/bin/updatedb ${ARGS} -OR- (b) Set ARGS=$(<... awk...) (without -f) and later call /usr/bin/updatedb -f "${ARGS}" (empty argument to -f is OK) 2) An already present lockfile will be removed by the second running instance of the script. If a third instance starts before the first one has finished, it won't see the lock. (updatedb running +2 days is not funny anyway, but if you do locking, then do it right.) You should set the trap right before 'touch "${LOCKFILE}"' to fix it, i.e., replace trap "rm -f ${LOCKFILE}" EXIT if [ -e "${LOCKFILE}" ]; then echo >&2 "Warning: \"${LOCKFILE}\" already present, not running updatedb ." exit 1 else touch "${LOCKFILE}" fi with if [ -e "${LOCKFILE}" ]; then echo >&2 "Warning: \"${LOCKFILE}\" already present, not running updatedb ." exit 1 fi trap "rm -f ${LOCKFILE}" EXIT touch "${LOCKFILE}"
Please don't CC others when you cannot assign bugs.
+ 31 Jan 2011; Tomáš Chvátal <scarabeus@gentoo.org> files/mlocate.cron-r2: + Fix premature removing of the lock file and parse the args more sanely when + there is no config around. This fixes bug #353270. +