LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise
User Name
Password
Linux - Enterprise This forum is for all items relating to using Linux in the Enterprise.

Notices


Reply
  Search this Thread
Old 12-03-2008, 11:10 AM   #1
Ziggie
Member
 
Registered: Nov 2005
Distribution: Red Hat AS 3
Posts: 49

Rep: Reputation: 15
RPM Hangs on RHEL 3


Hello all...

Running Red Hat Enterprise Linux 3 on a 2.4 kernel.

The other day I went to query the RPM database (rpm -qa |grep SDD) and after about 30 minutes I noticed that I had no results and the command did not complete.

So I ran rpm -qa with no grep on a second terminal, and it hung, with no output.

Control C did not cancel the commands. viewing the processlist showed about 40 rpm queries running, using the following entries:

root 29389 28763 0 06:02 ? 00:00:00 /bin/sh /etc/cron.daily/rpm
root 29390 28763 0 06:02 ? 00:00:00 awk -v progname=/etc/cron.daily/rpm progname {????? print progname ":\n"????? progname="";???? }???? { print; }
root 29391 29389 0 06:02 ? 00:00:00 /usr/lib/rpm/rpmq -q --all --qf %{name}-%{version}-%{release}.%{arch}.rpm\n


None of them appeared to be going anywhere either (they stretched back for a while).

So i attempted a kill command on my rpm queries, with no results. I had to resort to kill-9.

I killed all the rpm commands that appeared in the process list too. They weren't doing anything, I thought maybe the original one hung up and they all got stuck. But still, rpm queries keep failing.

What's going on with my rpm database?

on an aside, I noticed too that my locate database is more than 8 days out of date. Not sure when that stopped working. Could it be related?

Thanks in advance.

--zigg

Last edited by Ziggie; 12-03-2008 at 11:11 AM.
 
Old 12-03-2008, 12:28 PM   #2
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,336

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
You could try to rebuild the rpm data base using the rpm command:

rpm --rebuilddb

See:

man rpm

--------------------
Steve Stites

P.S. Another possibility is that there may be a lock file for the rpm data base which did not get deleted properly. I don't remember where the rpm data base lock file is. It might be in /var or perhaps /etc. You could try to find it with these commands:

find /var -iname "*lock*"

find /etc -iname "*lock*"

Last edited by jailbait; 12-03-2008 at 12:31 PM.
 
Old 12-03-2008, 01:55 PM   #3
Ziggie
Member
 
Registered: Nov 2005
Distribution: Red Hat AS 3
Posts: 49

Original Poster
Rep: Reputation: 15
I found a lock file here: /usr/lib/rpm/rpmdb_deadlock
but that file was created in April of 2006.
I didn't see any lock files pertaining to rpm in /var or /etc. Most of the lock files dealt with databases, the rest were rsync, nfs, etc.

I am running the rpm --rebuilddb -v now, but it's been 10 minutes and there has been no output from this command. I don't think it's actually doing anything, but I'll give it some more time and see.

This is our main production server, so I may reboot it this weekend to see if that clears up whatever the issue is.

Thanks for the help.

--zig
 
Old 12-03-2008, 02:41 PM   #4
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,336

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
Quote:
Originally Posted by Ziggie View Post

I am running the rpm --rebuilddb -v now, but it's been 10 minutes and there has been no output from this command. I don't think it's actually doing anything, but I'll give it some more time and see.
Something is wrong. Rebuild shouldn't take anywhere near that long.

I took a look at my CentOS system which is rpm based. It has a file called /usr/lib/rpm/rpmdb_deadlock even though I am not currently booted into CentOS.


--------------------------
Steve Stites
 
Old 12-03-2008, 02:55 PM   #5
Ziggie
Member
 
Registered: Nov 2005
Distribution: Red Hat AS 3
Posts: 49

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by jailbait View Post
Something is wrong.
Yes, this much I gathered.

Any troubleshooting suggestions?
 
Old 12-03-2008, 04:04 PM   #6
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,336

Rep: Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548Reputation: 548
Quote:
Originally Posted by Ziggie View Post

Any troubleshooting suggestions?
When you take down the system I suggest that you run fsck against the unmounted partition containing the rpm database.

-------------------
Steve Stites
 
Old 12-04-2008, 08:18 AM   #7
Ziggie
Member
 
Registered: Nov 2005
Distribution: Red Hat AS 3
Posts: 49

Original Poster
Rep: Reputation: 15
Apparently, this was the problem:

Quote:
perhaps it's the famous rpm bug..... try this:

after kill -9, remove __db.001 002 003 from /var/lib/rpm then try again

Code:
 rm -rf /var/lib/rpm/__db.00?
good luck
Found it here: http://www.linuxforums.org/forum/red...just-hang.html

Thanks for the help though!
 
Old 12-04-2008, 10:10 AM   #8
judge312
LQ Newbie
 
Registered: Dec 2008
Distribution: fedora,rhel
Posts: 18

Rep: Reputation: 1
remove cached DB
rm -rf /var/lib/rpm/__db.00*
rpm --rebuilddb

for advanced debugging (while hanged )
strace rpm -qa
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
RHEL 5 nfs mount hangs on RHEL 3 gwasigh Linux - Networking 1 06-13-2008 10:43 PM
RHEL 5: rpm --aid or rpmdb-redhat.rpm no longer supported mjcocat Linux - Enterprise 1 06-05-2008 08:41 PM
console login hangs RHEL 3 darrenprog Linux - General 7 06-11-2007 04:43 PM
RHEL hangs jacq Linux - Software 3 08-02-2006 05:08 AM
RHEL 4 hangs on AMD 64bit PC sushil_gambhir Red Hat 2 06-08-2006 11:18 PM

LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise

All times are GMT -5. The time now is 10:34 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration