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

Re: dselect deja de funcionar



On Mon, 12 Oct 1998, Antonio Castro wrote:

> Warning: Older releases of .bin/createlist used HARDlinks to link
> files from the lists directories to the .etc directory. This was
> not good, because updating the configuration files in .etc actually
> would make these files not to be linked anymore. You might want
> to stop here (by pressing Control-C, instead of pressing Enter)
> and transform all those hardlinks into symlinks before upgrading.
> 
> Press Control-C now, or else press Enter to continue
> 
> Menuda advertencia.
> 
> Pues como siempre estoy a tiempo de volverlo a intentar doy
> Control-C a la espera de noticias. No se cuales son los links 
> que debo de cambiar.

Hola. Esta advertencia la escribí yo...

Se trata de que cuando creas una lista con smartlist, digamos la lista
"naranjas", él te crea un directorio /var/list/naranjas, y de ahí crea
enlaces (duros) a varios ficheros que hay en /var/list/.etc.

Los enlaces duros no son adecuados para esto, porque no se conservan al 
hacer la actualización, así que lo mejor es convertir los enlaces duros
en simbólicos *antes* de actualizar (de ahí que la advertencia tenga que
hacerse en el preinst, y dando posibilidad para cortar el proceso).

En el anexo incluyo un script que a lo mejor te sirve para esto.

-- 
 "6d950e44c0742eac6a019715964df03d" (a truly random sig)
#!/bin/sh

filestosymlink="rc.submit rc.init rc.request help.txt subscribe.txt \
                unsubscribe.txt archive.txt reject"

cd /var/list
# Note: touching .etc/rc.lock makes incoming mails to be on hold
# temporarily, while we convert hardlinks into symlinks.
# See the smartlist Manual for details.
touch .etc/rc.lock
echo Please wait for 5 seconds.
sleep 5
echo Converting most hardlinks into symlinks...
for a in `ls`; do
  if [ -d $a ]; then
    cd $a
    if [ -d archive ]; then
      for b in $filestosymlink; do
        if [ -f $b ]; then
          inode1=`ls -li ../.etc/$b | awk '{ print $1 }'`
          inode2=`ls -li $b | awk '{ print $1 }'`
          if [ "$inode1" = "$inode2" ]; then
            rm -f $b
            ln -s ../.etc/$b
          fi
        fi
      done
    fi
    cd ..
  fi
done
rm -f .etc/rc.lock
echo Done.

Reply to: