Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Tue Oct 12, 2004 5:44 pm 
Offline
Newbie

Joined: Tue Oct 12, 2004 5:41 pm
Posts: 4
Sorry if this may seem like a dumb question, but I just installed fedora core 2 on my linode and the commands locate or updatedb do not seem to be working.

What do I need to do to get this working or what are the equivalent commands in fedora core 2. Any help is appreciated, as I'm completely new to this.

Thanks


Top
   
PostPosted: Tue Oct 12, 2004 9:15 pm 
Offline
Senior Member

Joined: Thu Aug 28, 2003 12:57 am
Posts: 273
amhost wrote:
Sorry if this may seem like a dumb question, but I just installed fedora core 2 on my linode and the commands locate or updatedb do not seem to be working.

What do I need to do to get this working or what are the equivalent commands in fedora core 2. Any help is appreciated, as I'm completely new to this.

Thanks


Those databases are built by cron jobs which usually run daily, but I think that caker changed the install images to run them weekly to reduce cron job load on the host systems. The easiest way to make these cron jobs run early and thus create the databases you need for the locate and updatedb commands is just to run the scripts themselves - you should be able to find them in /etc/cron.weekly, I think they're called slocate and makewhatis or something like that.


Top
   
 Post subject:
PostPosted: Tue Oct 12, 2004 10:12 pm 
Offline
Newbie

Joined: Tue Oct 12, 2004 5:41 pm
Posts: 4
thanks for the information, i will definitely look into it.


Top
   
 Post subject:
PostPosted: Wed Oct 13, 2004 12:43 am 
Offline
Newbie

Joined: Tue Oct 12, 2004 5:41 pm
Posts: 4
<< slocate >>

#!/bin/sh

# remove this to enable updating of updatedb
exit

renice +19 -p $$ >/dev/null 2>&1
/usr/bin/updatedb -f "nfs,smbfs,ncpfs,proc,devpts" -e "/tmp,/var/tmp,/usr/tmp,/afs,/net"

<<makewhatis>>
#!/bin/bash

LOCKFILE=/var/lock/makewhatis.lock

# the lockfile is not meant to be perfect, it's just in case the
# two makewhatis cron scripts get run close to each other to keep
# them from stepping on each other's toes. The worst that will
# happen is that they will temporarily corrupt the database...
[ -f $LOCKFILE ] && exit 0
trap "{ rm -f $LOCKFILE; exit 255; }" EXIT
touch $LOCKFILE
makewhatis -w
exit 0

===========================================

Ok, here are the contents of those files. Remember, i'm a complete n00b, how should I edit this configuration so that the cron job runs earlier.

Thanks for all your help


Top
   
 Post subject:
PostPosted: Wed Oct 13, 2004 12:54 am 
Offline
Senior Member

Joined: Thu Aug 28, 2003 12:57 am
Posts: 273
amhost wrote:
<< slocate >>

#!/bin/sh

# remove this to enable updating of updatedb
exit

renice +19 -p $$ >/dev/null 2>&1
/usr/bin/updatedb -f "nfs,smbfs,ncpfs,proc,devpts" -e "/tmp,/var/tmp,/usr/tmp,/afs,/net"

<<makewhatis>>
#!/bin/bash

LOCKFILE=/var/lock/makewhatis.lock

# the lockfile is not meant to be perfect, it's just in case the
# two makewhatis cron scripts get run close to each other to keep
# them from stepping on each other's toes. The worst that will
# happen is that they will temporarily corrupt the database...
[ -f $LOCKFILE ] && exit 0
trap "{ rm -f $LOCKFILE; exit 255; }" EXIT
touch $LOCKFILE
makewhatis -w
exit 0

===========================================

Ok, here are the contents of those files. Remember, i'm a complete n00b, how should I edit this configuration so that the cron job runs earlier.

Thanks for all your help


You don't edit the script, you just run it. cron will run the script once a week; if you want the same results (i.e. the building up of the databases) to happen now instead of in a week, then you can just run these scripts now instead of waiting for cron to do it (cron will still do it in a week too).

Just run the files, like:

bash$ /etc/cron.weekly/slocate
(watch its output, make sure everything was OK)

bash$ /etc/cron.weekly/makewhatis
(watch its output, make sure everything was OK)

You'll probably need to be logged in as root for these scripts to be able to do what they need to do.


Top
   
 Post subject:
PostPosted: Wed Oct 13, 2004 12:56 am 
Offline
Senior Member

Joined: Thu Aug 28, 2003 12:57 am
Posts: 273
Hey I just noticed something else. Looks like caker modified these files to not do anything at all, but to exit immediately. You'll need to remove the "exit" line after the "remove this to enable ..." comment as well. You need to do this for both the slocate and makewhatis scripts.


Top
   
 Post subject:
PostPosted: Wed Oct 13, 2004 1:17 am 
Offline
Newbie

Joined: Tue Oct 12, 2004 5:41 pm
Posts: 4
Thanks for the help again bji, really appreciate it.

I took out the exit line of code in the slocate.conf file and when I tried to run it, I received an error indicating that /usr/bin/updatedb/ was not found.

I got everything working now that I ran:

yum install slocate

Thanks for all your help again.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 7 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group