From bfea8d7d2fb35e2a722cd3e16f7b4126c18f7165 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Sun, 24 Aug 2014 14:46:06 +0200 Subject: [PATCH] findutils: Run updatedb once a week As suggested in bug #10303 --- config/findutils/updatedb | 16 ++++++++++++++++ config/rootfiles/common/fcron | 1 - config/rootfiles/common/findutils | 2 ++ lfs/findutils | 4 ++++ 4 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 config/findutils/updatedb diff --git a/config/findutils/updatedb b/config/findutils/updatedb new file mode 100644 index 0000000000..bc4809f916 --- /dev/null +++ b/config/findutils/updatedb @@ -0,0 +1,16 @@ +#!/bin/bash + +[ -x "/usr/bin/updatedb" ] || exit 0 + +LOCKFILE="/var/lib/locate/updatedb.lock" + +trap "rm -f $LOCKFILE" EXIT + +if [ -e "$LOCKFILE" ]; then + echo >&2 "Warning: $LOCKFILE present, not running updatedb." + exit 1 +else + touch "$LOCKFILE" +fi + +exec /usr/bin/updatedb diff --git a/config/rootfiles/common/fcron b/config/rootfiles/common/fcron index b3a1c49606..89f68a76cc 100644 --- a/config/rootfiles/common/fcron +++ b/config/rootfiles/common/fcron @@ -11,7 +11,6 @@ etc/fcron.hourly/info.txt etc/fcron.minutely/info.txt #etc/fcron.monthly etc/fcron.monthly/info.txt -#etc/fcron.weekly etc/fcron.weekly/info.txt usr/bin/fcronsighup usr/bin/fcrontab diff --git a/config/rootfiles/common/findutils b/config/rootfiles/common/findutils index 13cae26eb8..ac4fffe951 100644 --- a/config/rootfiles/common/findutils +++ b/config/rootfiles/common/findutils @@ -1,3 +1,5 @@ +#etc/fcron.weekly +etc/fcron.weekly/updatedb bin/find usr/bin/locate #usr/bin/oldfind diff --git a/lfs/findutils b/lfs/findutils index c05aca3cb7..e2dd04a022 100644 --- a/lfs/findutils +++ b/lfs/findutils @@ -91,6 +91,10 @@ ifeq "$(ROOT)" "" mv -v /usr/bin/find /bin sed -i -e 's|BINDIR=/usr/bin|BINDIR=/bin|' /usr/bin/updatedb -mkdir -p /var/lib/locate + + -mkdir -pv /etc/fcron.weekly + install -v -m 754 $(DIR_SRC)/config/findutils/updatedb \ + /etc/fcron.weekly/updatedb endif @rm -rf $(DIR_APP) @$(POSTBUILD) -- 2.39.5