Browse Source

don't suppress error output from running updatelocatedb

check that the resulting db works instead of some more specific test
okay schwarze@
OPENBSD_6_7
espie 4 years ago
parent
commit
e4cad6bb04
1 changed files with 7 additions and 5 deletions
  1. +7
    -5
      src/etc/weekly

+ 7
- 5
src/etc/weekly View File

@ -1,5 +1,5 @@
#
# $OpenBSD: weekly,v 1.28 2017/04/15 13:12:08 schwarze Exp $
# $OpenBSD: weekly,v 1.29 2019/12/30 16:49:51 espie Exp $
#
# For local additions, create the file /etc/weekly.local.
# To get section headers, use the function next_part in weekly.local.
@ -49,13 +49,15 @@ if [ -f /var/db/locate.database ]; then
trap 'rm -f $TMP; exit 1' 0 1 15
UPDATEDB="/usr/libexec/locate.updatedb"
echo "${UPDATEDB} --fcodes=- --tmpdir=${TMPDIR:-/tmp}" | \
nice -5 su -m nobody 2>/dev/null 1>$TMP
if [ -s "$TMP" ]; then
nice -5 su -m nobody 1>$TMP
if [ $? -ne 0 ]; then
echo "Rebuilding locate database failed"
elif ! locate -d $TMP /etc/weekly >/dev/null; then
echo "Not installing invalid locate database"
else
chmod 444 $TMP
chown root:wheel $TMP
mv -f $TMP /var/db/locate.database
else
echo "Not installing locate database; zero size"
fi
else
echo "Not rebuilding locate database; can't create temp file"


Loading…
Cancel
Save