LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Enterprise (https://www.linuxquestions.org/questions/linux-enterprise-47/)
-   -   RPM Hangs on RHEL 3 (https://www.linuxquestions.org/questions/linux-enterprise-47/rpm-hangs-on-rhel-3-a-688042/)

Ziggie 12-03-2008 11:10 AM

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

jailbait 12-03-2008 12:28 PM

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*"

Ziggie 12-03-2008 01:55 PM

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

jailbait 12-03-2008 02:41 PM

Quote:

Originally Posted by Ziggie (Post 3363370)

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

Ziggie 12-03-2008 02:55 PM

Quote:

Originally Posted by jailbait (Post 3363416)
Something is wrong.

Yes, this much I gathered. :D

Any troubleshooting suggestions?

jailbait 12-03-2008 04:04 PM

Quote:

Originally Posted by Ziggie (Post 3363429)

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

Ziggie 12-04-2008 08:18 AM

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!

judge312 12-04-2008 10:10 AM

remove cached DB
rm -rf /var/lib/rpm/__db.00*
rpm --rebuilddb

for advanced debugging (while hanged )
strace rpm -qa


All times are GMT -5. The time now is 10:44 PM.