Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 25 Sep 2000 02:51:34 -0700 (PDT)
From:      glenn@intextonline.com
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   conf/21535: /etc/periodic/weekly/310.locate only builds FULL system database without 'echo' and '|nice...' args 
Message-ID:  <20000925095134.C52BF37B422@hub.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         21535
>Category:       conf
>Synopsis:       /etc/periodic/weekly/310.locate only builds FULL system database without 'echo' and '|nice...' args
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Sep 25 03:00:01 PDT 2000
>Closed-Date:
>Last-Modified:
>Originator:     Glenn Graham
>Release:        3.4-release
>Organization:
inTEXT Communications USA Inc.
>Environment:
glenn@webserver$ uname -a
FreeBSD webserver.vancouverhost.net 3.4-RELEASE FreeBSD 3.4-RELEASE #0: Tue Dec
28 22:18:05 GMT 1999     jkh@highwing.cdrom.com:/usr/src/sys/compile/GENERIC  i386

>Description:
I discovered the problem first tonight when doing a 'locate portsentry.conf'
which resides in /usr/local/psionic/portsentry.  When I did a locate it 
didn't come up with the filename.  I was however able to find it by
doing find '/ -name portsentry.con -print'.

I then took a close examination of what shell was being used for the 
script ( sh ) and that nobody indeed was running
properly and that the cron was setup correct etc... cron shell
ok etc.

I then completely removed the /var/db/locate.database.  I then 
procedded to initate the update by hand, by touching the db file, 
then chowning, chmoding, and setting the perms to 644 as indicated 
by the  310.locate script.

I then ran ( by hand ) 'echo /usr/libexec/locate.updatedb | nice -5 su -fm nobody' 
and the system proceeded to initialize the rebuild of the database.

I then checked to ensure a new database file was indeed back in 
/var/db.. and it was.

I then did another 'locate portsentry.conf' and it WAS not in
the database.... However.. almost every other file on the
system was in the database.. that is to say files within
the root path.

I then started to look for files that would pertain to locate's path and
came up with /etc/locate.rc.  The path defined there was '/' which
simply tells me that it will search the tree '/' down.

Then I tried something else. I simply ran, by hand /usr/libexec/locate.updatedb.
( without nice ). The database once again began to build.  After it was built,
I , again did a 'locate portsentry.conf' and guess what ? It found
it exactly where it was supposed to be in /usr/psionic/portsentry !.
(portsentry.conf)

With this knowledge in hand, I then edited 310.locate to reflect the
command /usr/libexec/locate.updatedb without args, then ran 
'period weekly' again and the entire system was then completely
databased.

This is happening on 2 seperate systems, completely unrelated to 
each other.. and I'm sure it has to do with a path configuration
problem.
>How-To-Repeat:

Place a file in /usr/local/psionic/portsentry and run periodic weekly
with the 'out of the box' args for updatedb in 301.weekly either by
hand or from the cron.  Makes no difference either way.

Have I stumbled onto something here.. or am I just not
working updatedb properly by not placing the correct paths in 
/etc/locate.rc ??
>Fix:

The only way I have found to fix the problem is to remove;
'echo' from the beginning of the command and to remove
'| nice -5 su -fm nobody' from the end of the command, leaving
the binary to run simply as /usr/libexec.updatedb in 301.locate.

>Release-Note:
>Audit-Trail:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20000925095134.C52BF37B422>