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

Re: /etc/cron.daily/find says user does not exist



On 28 Apr 2003, Thomas Krennwallner wrote:
> On Mon Apr 28, 2003 at 08:57:46AM +0100, Anthony Campbell wrote:
> > Date: Mon, 28 Apr 2003 06:26:27 +0100
> > From: root@localhost (Cron Daemon)
> > Subject: Cron <root@arcadia> test -e /usr/sbin/anacron || run-parts --report /etc/cron.daily
> > To: root@localhost
> >
> > /etc/cron.daily/find:
> > User  does not exist.
> > run-parts: /etc/cron.daily/find exited with return code 1
> 
> Could you post the content of /etc/cron.daily/find? Mine looks like
> this:
> 
> if [ -f /etc/updatedb.conf ]; then
>   . /etc/updatedb.conf
> fi
> 
> cd / && updatedb --localuser=nobody 2>/dev/null
> 
> Maybe the updatedb has a crippeled --localuser or something sets
> LOCALUSER="". Maybe a grep for LOCALUSER locates something special.
> 
> so long
> Thomas
> 
> --

I have:


#! /bin/sh
#
# cron script to update the `find.codes' database.
#
# Written by Ian A. Murdock <imurdock@debian.org> and 
#            Kevin Dalley <kevin@aimnet.com>

if [ -f /etc/updatedb.conf ]; then
  . /etc/updatedb.conf
fi

if cut -f1 -d: /etc/passwd | grep -q ^$LOCALUSER$ ; then
  cd / && updatedb 2>/dev/null
else
  echo "User $LOCALUSER does not exist."
  exit 1
fi


The odd thing is that if I run this script directly it works correctly.

AC


-- 
ac@acampbell.org.uk    ||  http://www.acampbell.org.uk
using Linux GNU/Debian ||  for book reviews, electronic 
Windows-free zone      ||  books and skeptical articles



Reply to: