[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [Sarge3.1] Plus de locate, plus d' updatedb



Sébastien BARTHÉLEMY a écrit :
bourgoin gilles <gilles.bourgoin@free.fr> writes:

  
Bonjour,

Du côté du cron, doit-il y avoir quelque chose ?
    
oui, c'est dans le fichier /etc/cron.daily/find qui est lancé par
cron, sauf si anacron est installé, auquel cas c'est anacron qui s'en
charge (cfr. /etc/crontab).

Tu dois installer anacron si ton ordinateur n'est pas allumé en
permanence.

  
Merci pour les infos, je ne connaissais pas anacron.

Du côté du cron, j'ai bien tous ce qu'il faut :
- /etc/cron.daily/find
- J'ai vérifier le contenu, et c'est correct.

Pour le /etc/updatedb.conf utilisé par le find du cron, j'ai aussi
regardé son contenu. Le fichier est présent et je ne vois rien de
particulier qui explique le problème.

Donc, faute d'idée j'ai mis des traces dans le /usr/bin/updatedb.
malgré mon inexpérience en script sh.

L'écho que j'obtiens avec le updatedb+trace est ci-dessous. Je joins
le aussi un extrait du updatedb auquel je n'ai ajouté plusieurs écho "(xx)". :

Echo:
nameofserver:/usr/bin# updatedb
(1)
(2)
(3)
(31)
(32)
(33)
(38)
(4)
(41)
(8)
nameofserver:/usr/bin#

En ajoutant les traces, j'ai vu dans le code du updatedb un FIXME qui m'inquites ?
Est-ce que le code updatedb a évolué récemment ?

Deplus, si j'interpréte bien le source, j'ai l'impression que les commandes
find comprises dans l'accolade du if sous le FIXME ne peuvent pas s'exécuter ?
Est-ce que je me trompe ?

Encore merci
gilles


PJ : Voici Extrait du updatedb avec trace et le /var/cache/locate/locatedb :

Make and code the file list.
# Sort case insensitively for users' convenience.

echo "(31)"
rm -f $LOCATE_DB.n
trap 'rm -f $LOCATE_DB.n; exit' HUP TERM

echo "(32)"
if test $old = no; then

echo "(33)"
# FIXME figure out how to sort null-terminated strings, and use -print0.
if {
cd "$changeto"
echo "(34)"
if test -n "$SEARCHPATHS"; then
  if [ "$LOCALUSER" != "" ]; then
    # : A1
    echo "(35)"
    su $LOCALUSER `select_shell $LOCALUSER` -c \
    "$find $SEARCHPATHS $FINDOPTIONS \
     \\( $prunefs_exp \
     -type d -regex '$PRUNEREGEX' \\) -prune -o $print_option"
  else
    # : A2
    echo "(36)"
    $find $SEARCHPATHS $FINDOPTIONS \
     \( $prunefs_exp \
     -type d -regex "$PRUNEREGEX" \) -prune -o $print_option
  fi
fi

if test -n "$NETPATHS"; then
myuid=`getuid`
if [ "$myuid" = 0 ]; then
    # : A3
    su $NETUSER `select_shell $NETUSER` -c \
     "$find $NETPATHS $FINDOPTIONS \\( -type d -regex '$PRUNEREGEX' -prune \\) -o $print_option" ||
    echo "(36)"
    exit $?
  else
    # : A4
    $find $NETPATHS $FINDOPTIONS \( -type d -regex "$PRUNEREGEX" -prune \) -o $print_option ||
    echo "(37)"
    exit $?
  fi
fi
} | $sort -f | $frcode $frcode_options > $LOCATE_DB.n


then
    # OK so far
    true
    echo "(38)"
else
    echo "(39)"
    rv=$?
    echo "Failed to generate $LOCATE_DB.n" >&2
    rm -f $LOCATE_DB.n
    exit $rv
fi

echo "(4)"

-----------------------------------------------------------------------------------------------
Contenu du /var/cache/locate/locatedb généré :

nameofserver:/var/cache/locate# cat locatedb
LOCATE02(34)
(36)
nameofserver:/var/cache/locate#



Reply to: