To update timezone to support DST on RedHat systems.

To verify the current 2007 timezone settings.

#zdump -v /etc/localtime | grep 2007

————————————————————————————————————–

/etc/localtime.orig Sun Apr 1 09:59:59 2007 UTC = Sun Apr 1 01:59:59 2007 PST isdst=0 gmtoff=-28800
/etc/localtime.orig Sun Apr 1 10:00:00 2007 UTC = Sun Apr 1 03:00:00 2007 PDT isdst=1 gmtoff=-25200
/etc/localtime.orig Sun Oct 28 08:59:59 2007 UTC = Sun Oct 28 01:59:59 2007 PDT isdst=1 gmtoff=-25200
/etc/localtime.orig Sun Oct 28 09:00:00 2007 UTC = Sun Oct 28 01:00:00 2007 PST isdst=0 gmtoff=-28800
————————————————————————————————————–

cd /usr/local/src

mkdir tzdata2007c

Downloaded the following ftp://elsie.nci.nih.gov/pub/tzdata2007c.tar.gz.

Here is the version I used:
Updated time zone source files.

wget ftp://elsie.nci.nih.gov/pub/tzdata2007c.tar.gz

tar -zxvf tzdata2007c.tar.gz
zic -d /tmp/zoneinfo northamerica
cd /tmp/zoneinfo/

Verify the compiled timezone files are correct:

zdump -v /tmp/zoneinfo/PST8PDT | grep 2007

————————————————————————————————————–

/tmp/zoneinfo/PST8PDT Sun Mar 11 09:59:59 2007 UTC = Sun Mar 11 01:59:59 2007 PST isdst=0 gmtoff=-28800
/tmp/zoneinfo/PST8PDT Sun Mar 11 10:00:00 2007 UTC = Sun Mar 11 03:00:00 2007 PDT isdst=1 gmtoff=-25200
/tmp/zoneinfo/PST8PDT Sun Nov 4 08:59:59 2007 UTC = Sun Nov 4 01:59:59 2007 PDT isdst=1 gmtoff=-25200
/tmp/zoneinfo/PST8PDT Sun Nov 4 09:00:00 2007 UTC = Sun Nov 4 01:00:00 2007 PST isdst=0 gmtoff=-28800
————————————————————————————————————–
cd /usr/share/zoneinfo/
cp -p PST8PDT PST8PDT.orig
cp /tmp/zoneinfo/PST8PDT .
cd America/
cp -p Los_Angeles Los_Angeles.orig
cp /tmp/zoneinfo/PST8PDT Los_Angeles

Verify the copied files are correct:

zdump -v /usr/share/zoneinfo/PST8PDT | grep 2007

————————————————————————————————————–

/usr/share/zoneinfo/PST8PDT Sun Mar 11 09:59:59 2007 UTC = Sun Mar 11 01:59:59 2007 PST isdst=0 gmtoff=-28800
/usr/share/zoneinfo/PST8PDT Sun Mar 11 10:00:00 2007 UTC = Sun Mar 11 03:00:00 2007 PDT isdst=1 gmtoff=-25200
/usr/share/zoneinfo/PST8PDT Sun Nov 4 08:59:59 2007 UTC = Sun Nov 4 01:59:59 2007 PDT isdst=1 gmtoff=-25200
/usr/share/zoneinfo/PST8PDT Sun Nov 4 09:00:00 2007 UTC = Sun Nov 4 01:00:00 2007 PST isdst=0 gmtoff=-28800

————————————————————————————————————–

zdump -v /usr/share/zoneinfo/America/Los_Angeles | grep 2007

————————————————————————————————————–

/usr/share/zoneinfo/America/Los_Angeles Sun Mar 11 09:59:59 2007 UTC = Sun Mar 11 01:59:59 2007 PST isdst=0 gmtoff=-28800
/usr/share/zoneinfo/America/Los_Angeles Sun Mar 11 10:00:00 2007 UTC = Sun Mar 11 03:00:00 2007 PDT isdst=1 gmtoff=-25200
/usr/share/zoneinfo/America/Los_Angeles Sun Nov 4 08:59:59 2007 UTC = Sun Nov 4 01:59:59 2007 PDT isdst=1 gmtoff=-25200
/usr/share/zoneinfo/America/Los_Angeles Sun Nov 4 09:00:00 2007 UTC = Sun Nov 4 01:00:00 2007 PST isdst=0 gmtoff=-28800

————————————————————————————————————–

cp -p localtime localtime.orig
ln -fs /usr/share/zoneinfo/PST8PDT localtime

Verify the currently set timezone is correct:
zdump -v /etc/localtime | grep 2007

————————————————————————————————————–

/etc/localtime Sun Mar 11 09:59:59 2007 UTC = Sun Mar 11 01:59:59 2007 PST isdst=0 gmtoff=-28800
/etc/localtime Sun Mar 11 10:00:00 2007 UTC = Sun Mar 11 03:00:00 2007 PDT isdst=1 gmtoff=-25200
/etc/localtime Sun Nov 4 08:59:59 2007 UTC = Sun Nov 4 01:59:59 2007 PDT isdst=1 gmtoff=-25200
/etc/localtime Sun Nov 4 09:00:00 2007 UTC = Sun Nov 4 01:00:00 2007 PST isdst=0 gmtoff=-28800
————————————————————————————————————–

Fedora/CentOS/Redhat Enterprise Linux – yum hangs

Here is the procedure I have used to fix yum when it hangs. Usually, I will find one or more of the following kinds of rpm processes “running”:

# ps -ef | grep rpm
root 27265 26840 0 Feb05 ? 00:00:00 awk -v progname=/etc/cron.daily/rpm progname {????? print progname “:\n”????? progname=””;???? }???? { print; }

The first thing I do is cancel or kill my yum processes. Then, I kill all the running rpm processes using the following:

# killall -9 -r “.*rpmq.*”

Next, I remove all the __ files in the /var/lib/rpm directory:

# cd /var/lib/rpm
# ls
Basenames __db.000 __db.002 Dirnames Group Name Providename Pubkeys Requireversion Sigmd5
Conflictname __db.001 __db.003 Filemd5s Installtid Packages Provideversion Requirename Sha1header Triggername
# rm _*
rm: remove regular empty file `__db.000′? y
rm: remove regular file `__db.001′? y
rm: remove regular file `__db.002′? y
rm: remove regular file `__db.003′? y

Then, rebuild the rpm database:

# rpm –rebuilddb

I usually clean out the yum cache files by running the following:

# yum clean all

Protected: Commands, notes, and misc information (linux, Unix and Windows).

This content is password protected. To view it please enter your password below:

Postfix/amavisd perfomance – server crash

Yesterday, I had interesting mail problem that I believe is still occurring today only on a much smaller scale. One on my servers crashed a couple times. I believe this is because the server was overloaded trying to process too many mail messages at once.

I ended up having to add the following line to main.cf on both of my mail servers:

smtp-amavis_destination_concurrency_limit = 2

I found this in the amavisd documentation for a postfix installation. I never went into the performance tweaks documented. I had about 200 messages queued up on my secondary server. Whenever, I tried to process them, my primary server got pounded. I decided to process the couple messages that looked legitimate, and delete all the others. So far, with the new settings mentioned above and deleting the pending unimportant messages in the secondary queue, things have been working fine. I guess I should RTFM a bit more on postfix and amavisd. Especially, since I am running these domains on older hardware.

Howto Install linux via grub.

What I used to install FC6 on the dell4100, from the information found on the
web below my write up.

1) Copy vmlinuz and initrd from isolinux directory on the first CD,
to /boot of the machine you want to install on.
2) Create grub entry on the machine you want to install on.
title Fedora Core 6 Install
kernel /vmlinuz-fc6install
initrd /initrd-fc6install.img
3) Setup up FTP, NFS or HTTP install location.
4) Boot installation target, and choose Fedora Core 6 Install.
5) When prompted, select the method that you setup in step 3.

How I setup install to use HTTP:
1) Copied the install to a common directory by mounting each CD using You
can overwrite on not overwrite the file prompted about. They are not
important or are the same:
mount -t iso9660 -o loop FC-6-i386-disc1.iso /mnt/tmp
cp -r /mnt/tmp/* /home/FC6
2) After all the CDs are copied, set the permissions to:
drwxr-xr-x 7 root root 4096 Oct 25 09:59 FC6

chown -R 755 /home/FC6
3) Create link in web server directory:
lrwxrwxrwx 1 root root 10 Oct 25 10:11 FC6 -> /home/FC6/

cd /var/www/html
ln -s /home/FC6

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

From the web:

1. Loopmount diskboot.img
2. Copy vmlinuz and initrd.img (with unique names) to your /boot directory
3. Configure grub (you should be on grub with RH7.3) to boot from the
copied kernel
4. At boot time type ‘linux askmethod’ and you’ll get to specify the
CDROM

I used this method to install FC3 online. Just downloaded the boot.iso
and chose ‘ftp’ as the install method…

or

1. Copy boot.iso to your hard disk
2. Configure grub to boot from the iso [0]
3. At boot time type ‘linux askmethod’ and you’ll get to specify the
CDROM

This assumes that there is a suitable scsi driver available in the
initrd.img. If not, you can go about it this way.

1. copy the contents of the CDs to the hard disk (second and subsequent
CDs’ rpm files go in the RPMS directory copied from the first CD
2. Use either of the above boot methods and specify ‘hard disk’ as the
source.

NB. Make sure you copy the CD contents to a filesystem that is _not_
going to be formatted at install time otherwise there’ll be nothing
there for the installer to use!

Conor

[0] Booting direct from an iso is mentioned here:
http://www.linux.ie/lists/pipermail/ilug/2005-February/022062.html

Basically, it’s:

grub> chainloader hd(0,0)/image.iso
grub> boot

Conor Daly

The loopmount is so you can get at the vmlinuz and initrd.img that you’re
going to use to boot from. Where did you get the files you copied? When
you say you modified grub.conf, do you mean to say you changed the
existing boot config rather than adding an extra one? Ooops! You’ll be
able to boot your original system in any case by using the grub shell at
boot time. My RH9 grub.conf has two sections, one to boot the system and
one to boot the FC3 installer (I plugged the spare disk into this machine
to start the install…). Each section looks like this:

title Red Hat Linux (2.4.20-8)
root (hd0,0)
kernel /boot/vmlinuz-2.4.20-8 ro root=/dev/hda1 hdc=ide-scsi
initrd /boot/initrd-2.4.20-8.img
title Fedora Core 3 install
root (hd0,0)
kernel /boot/vmlinuz-FC3-install text askmethod
initrd /boot/initrd-FC3-install.img

The “Red Hat Linux” section boots my main kernel and your main kernel will
look similar but with different version numbers. The “Fedora Core 3
install” section boots the installer’s kernel instead. You need to modify
your grub.conf so that you have both sections. This actually won’t matter
once the upgrade happens since it will overwrite your grub.conf but, in
the meantime…

Since you can’t boot your RH7.3 kernel at present, you can go about things
two ways. 1. Boot interactively using grub. 2. Boot the installer,
mount your current partitions, edit grub.conf and reboot.

1. Interactively using grub
o boot the machine, at the grub screen, press ‘e’ to edit
o select the ‘kernel’ line and press ‘e’ again to edit
o Set the kerenl line to the correct vmlinuz-… root=/dev/hd… and press

o select the ‘initrd’ line and press ‘e’ to edit
o set the initrd line to the correct initrd… and press
o press ‘b’ to boot
o once booted, edit /etc/grub.conf to include correct values.

2. Using the FC installer
o boot the machine, at the grub screen, press ‘e’ to edit
o select the ‘kernel’ line and press ‘e’ again to edit
o remove the ‘askmethod’ keyword and instead type ‘rescue’ and press

o press ‘b’ to boot
o once booted, it should tell you where your original system is mounted
it may even do a chroot
o edit /etc/grub.conf to include correct values.
o type ‘exit’ to reboot.

That should get you back to being able to boot your RH7.3 system. Of
course, you could just go ahead and run the FC3 installer and do the
system upgrade…

Conor`

Conor Daly

Domestic Sysadmin 🙂
———————
Hobbiton.cod.ie
10:34:05 up 2 days, 21:54, 1 user, load average: 0.04, 0.03, 0.00

Return top

INFORMATION