SysAdmin

rpmdb: unable to join the environment

by damonp on September 10, 2007

in SysAdmin

This weekend I was contacted by a client regarding a server that had run out of room on the main hard drive. Among the things that were corrupted by the drive filling up was the RPM database.

When trying to query of upgrade any package, the error message

rpmdb: unable to join the environment
error: db4 error(11) from dbenv->open: Resource temporarily unavailable
error: cannot open Packages index using db3 - Resource temporarily unavailable (11)
error: cannot open Packages database in /var/lib/rpm
warning: /root/webmin-1.360-1.noarch.rpm: V3 DSA signature: NOKEY, key ID 11f63c51
rpmdb: unable to join the environment
error: db4 error(11) from dbenv->open: Resource temporarily unavailable
error: cannot open Packages database in /var/lib/rpm
rpmdb: unable to join the environment
error: db4 error(11) from dbenv->open: Resource temporarily unavailable
error: cannot open Packages database in /var/lib/rpm

A search turned up this howto on repairing the db.

These two commands made quick work of the fix. First remove any old lock files:

rm -f /var/lib/rpm/__db*

Then rebuild the RPM database:

rpm -vv --rebuilddb

Popularity: 5%

{ 3 comments }

ssh-keygen -t dsa -b 1024
[root@titan .ssh]# ssh-keygen -t dsa -b 1024
Generating public/private dsa key pair.
Enter file in which to save the key (/root/.ssh/id_dsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_dsa.
Your public key has been saved in /root/.ssh/id_dsa.pub.
The key fingerprint is:
d2:32:02:4e:25:27:53:8f:c1:ab:80:02:0f:25:da:af root@host.domain.com

Then copy in any public keys into ~/.ssh/authorized_keys

Popularity: 3%

{ 0 comments }

Lighttpd vs thttpd Update3

7 August 2007

I have been asked several times recently about my original comparison of Lighttpd and thttpd and subsequent benchmarks for Lighttpd vs thttpd. I do not have updated benchmarks for these two. However, Lighttpd is still under active development with the latest release Lighttpd 1.4.16 dated 7/24/07. The most recent thttpd release has a newest file [...]

Read the full article →

Plesk Qmail and Remote Black Lists (or Plesk says Qmail not started)

7 July 2007

With the recent increase in SPAM volume, I have had two clients contact me with Qmail problems on Plesk servers. The error they were receiving was in the status page of the Plesk admin panel. Under the status line for Qmail, Plesk said Qmail not started Several attempts to restart Qmail produced the same results. [...]

Read the full article →

Exim Queue Snippets

28 June 2007

These are all useful when trying to track down an open formmail script. List bounce messages exiqgrep -f ‘^<>$’ Freeze bounce messages exiqgrep -i -f ‘^<>$’ | xargs exim -Mf Freeze messages from user@domain.com exiqgrep -i -f user@domain.com| xargs exim -Mf Find out what user your webserver runs as. Use this as the email address [...]

Read the full article →

Recursive Chmod Tricks

27 June 2007

Recursively chmod only directories find . -type d -exec chmod 755 {} \; Similarly, recursively set the execute bit on every directory chmod -R a+X * The +X flag sets the execute bit on directories only Recursively chmod only files find . -type f -exec chmod 644 {} \; Recursively chmod only PHP files (with [...]

Read the full article →

Qmailscan Report

7 May 2007

more /var/spool/qmailscan/quarantine.log | grep "`date ‘+%d %b %Y’`" | cut -f5 | sort | uniq -c | sort

Read the full article →

Lsof Tricks

10 April 2007

Lsof (LiSt Open Files) is a powerful Unix command utility that comes in handy in many security and performance related sysadmin tasks. List the PIDs of running httpd processes. The -t option specifies terse output, only PIDs. lsof -t `which httpd` List process listening to port 80. lsof -i : 80 List processes of the [...]

Read the full article →

Quick and Dirty MySQL Backup Script

14 March 2007

I previously posted a Quick and Dirty MySQL Backup snippet that has gotten a bit of traffic. It works well in a pinch, but it doesn’t have any features. I use it primarily as a safety backup when performing maintenance on a MySQL server. Several of my clients have requested a script that they can [...]

Read the full article →

Update tzdata for New Daylight Savings Time

10 March 2007

The fed mandated daylight savings time changes go into effect this weekend. To ensure you have the updated days do a quick test zdump -v /etc/localtime | grep 2007 If you see this Sunday’s date March 11 2007 then you have the updated package. Sunday’s DST change should be handled. [root@calypso files]# zdump -v /etc/localtime [...]

Read the full article →