Update a kickstart installation in the %post section

Add this to the %post section of your kickstart file:

# Update server from RHN
rpm –import /usr/share/rhn/RPM-GPG-KEY
rhnreg_ks –force –profilename ${HOSTNAME:-“tmp-host-name.mydomain.com”} –username myrhnuser
–password myrhnpasswd
up2date –nox –force –update -v

Does my CPU support Xen?

For a para-virtualized guest, your CPU only needs to support the PAE flag:

$ grep pae /proc/cpuinfo

For a fully-virtualized guest, your CPU must support either the “vmx” flag for an Intel processor, or the “svm” flag if your processor is from AMD. Run this command to find out:

grep ‘^flags.*(vmx|svm)’ /proc/cpuinfo

SNMP script problem

Do you see something like this, every 15 seconds or so in your /var/log/messages file:

May 21 12:33:57 usatl01lo605 snmpd[10167]: Connection from – 127.0.0.1
May 21 12:33:57 usatl01lo605 snmpd[10167]: transport socket = 16
May 21 12:34:12 usatl01lo605 snmpd[10167]: Connection from – 127.0.0.1
May 21 12:34:12 usatl01lo605 snmpd[10167]: transport socket = 16

This is due to an incorrect setting in the /etc/init.d/snmpd script. Open this script and change this line:

OPTIONS=”-Lsd -Lf /dev/null -p /var/run/snmpd.pid -a”

to this:

OPTIONS=”-LS 4 d -p /var/run/snmpd.pid -a”

Then restart the snmp service (“service snmpd restart). You will see the incessant logging in the messages file cease.

dmidecode for hardware info

Dmidecode dumps the System Management BIOS. Use this built-in tool to get information on your motherboard, CPU, RAM chips, and more! Here’s a sample:

Handle 0x0007, DMI type 6, 12 bytes.
Memory Module Information
Socket Designation: DIMM 2
Bank Connections: 2 3
Current Speed: Unknown
Type: DIMM SDRAM
Installed Size: 512 MB (Double-bank Connection)
Enabled Size: 512 MB (Double-bank Connection)
Error Status: OK

ntpdate equivalent command when running NTP service

If your Linux clock is more than a minute or two off, you might be tempted to use the “ntpdate” program to update the clock one time. However, the ntpdate program cannot run while the ntp daemon is running (not to mention the fact the ntpdate function is set to be retired).

You can mimic the functionality of the ntpdate command by issuing the “ntpd -q -g” command. This updates the clock, telling the ntp daemon to ignore the ‘sanity limit’ of 1000 seconds, and exit after updating the clock.