Pkgstoinstallnotup

Pkgstoinstallnotup

Pkgstoinstallnotup

Redhat Server Time Run Out

Posted by Planet Malaysia on July 24, 2006

This morning I was noticed that all my server [tag]time[/tag] are running out What Happen?

After further investigate, I found that [tag]Redhat[/tag] did an automatic [tag]up2date[/tag] updated. More than 20 packages are updated last night, my /etc/localtime was overwrite.


[user1@planetmy user1]$rpm -qf /etc/localtime
glibc-2.3.2-95.44

My RHEL 3 Redhat Network(RHN) updated glibc last night.

So how to solve this problem in the future?

First run the command:


sudo up2date --configure
0.adminAddress ['root@localhost']
1.debug No
2.disallowConfChange ['noReboot', 'sslCACert', 'useNoSSLForPackages', 'noSSLSe
3.enableProxy No
4.enableProxyAuth No
5.enableRollbacks No
6.fileSkipList ['/etc/localtime']
7.forceInstall No
8.gpgKeyRing /etc/sysconfig/rhn/up2date-keyring.gpg
9.headerCacheSize 40
10.headerFetchCount 10
11.httpProxy
12.isatty Yes
13.keepAfterInstall No
14.networkRetries 5
15.networkSetup Yes
16.noBootLoader No
17.noReboot No
18.noReplaceConfig Yes
19.noSSLServerURL http://xmlrpc.rhn.redhat.com/XMLRPC
20.pkgSkipList ['kernel*']
21.pkgsToInstallNotUp ['kernel', 'kernel-modules']
22.proxyPassword
23.proxyUser
24.removeSkipList ['kernel*']
25.retrieveOnly No
26.retrieveSource No
27.rhnuuid fcdbeee8-a2e5-11d9-82a5-1202b39c34ca
28.serverURL https://xmlrpc.rhn.redhat.com/XMLRPC
29.showAvailablePacka No
30.sslCACert /usr/share/rhn/RHNS-CA-CERT
31.storageDir /var/spool/up2date
32.systemIdPath /etc/sysconfig/rhn/systemid
33.updateUp2date Yes
34.useGPG Yes
35.useNoSSLForPackage No
36.useRhn Yes
37.versionOverride
Enter number of item to edit:

Choose option no.6

Enter /etc/localtime:

Attribute: fileSkipList
Comment: A list of file names, optionally including wildcards, to skip
Current value: /etc/localtime;
New Value: /etc/localtime

Restored my server time:

mv /etc/localtime /etc/localtime.backup
ln -s /usr/share/zoneinfo/Asia/Kuala_Lumpur /etc/localtime
/etc/init.d/ntpd restart

Possibly Related Posts:

  • Streamyx Speed Test
  • TMNET Unifi Really Fast?
  • Leklai
  • Apple iPhone Don’t Like Me
  • Web Hosting Choice

By default Cpanel servers do not allow kernel upgrading with up2date. This is to avoid important software like kernel get updated with out your knowledge.

up2date have pkgSkipList option which allow you to specify which packages do not update. On Cpanel servers, you will find pkgSkipList have following packages listed

kernel*; courier*; mysql*; spamassassin*; httpd*; perl; mysql*; php*; mod_ssl*;

Other than kernel, other softwares in the list are provided by cpanel, so installing OS provided version of these software will break Cpanel Server.

You need to upgrade kernel at times to keep your server secure. To do this, you need to remove kernel* from pkgSkipList

This can be done with command up2date –configure and on the prompt, you have to enter number corresponding to pkgSkipList to edit it values. Take a copy of existing values and enter new value, with out kernel*, to save just hit enter key. You will be back in command prompt.

# up2date –configure
0. debug No
1. useRhn Yes
2. rhnuuid 16742c3c-9744-11da-8231-00123f7395f8
3. isatty Yes
4. showAvailablePacka No
5. useNoSSLForPackage No
6. storageDir /var/spool/up2date
7. pkgSkipList ['courier*', 'mysql*', 'spamassassin*', 'httpd*', 'perl',
8. retrieveOnly No
9. noSSLServerURL http://rhn.ev1servers.net/XMLRPC
10. networkSetup Yes
11. networkRetries 5
12. pkgsToInstallNotUp ['kernel', 'kernel-modules', 'kernel-devel']
13. enableProxy No
14. noBootLoader No
15. proxyPassword
16. updateUp2date Yes
17. keepAfterInstall No
18. useGPG Yes
19. headerCacheSize 40
20. forceInstall No
21. systemIdPath /etc/sysconfig/rhn/systemid
22. retrieveSource No
23. enableRollbacks No
24. gpgKeyRing /etc/sysconfig/rhn/up2date-keyring.gpg
25. adminAddress ['root@localhost']
26. serverURL https://rhn.ev1servers.net/XMLRPC
27. fileSkipList []
28. versionOverride
29. sslCACert /usr/share/rhn/RHN-ORG-TRUSTED-SSL-CERT
30. noReplaceConfig Yes
31. enableProxyAuth No
32. disallowConfChange ['noReboot', 'sslCACert', 'useNoSSLForPackages', 'noSSLSe
33. headerFetchCount 10
34. proxyUser
35. removeSkipList ['kernel*']
36. httpProxy
37. noReboot No

Enter number of item to edit : 7

Attribute: pkgSkipList
Comment: A list of package names, optionally including wildcards, to skip
Current value: kernel*; courier*; mysql*; spamassassin*; httpd*; perl; mysql*; php*; mod_ssl*;

New Value: courier*; mysql*; spamassassin*; httpd*; perl; mysql*; php*; mod_ssl*;

Now you can upgrade kernel with

up2date -u

# up2date -u

Fetching Obsoletes list for channel: rhel-x86_64-es-4…

Fetching Obsoletes list for channel: rhel-x86_64-es-4-extras…

Fetching rpm headers…
#################

Name Version Rel
——————-

kernel 2.6.9 22.0.2.EL x86_64
kernel-smp 2.6.9 22.0.2.EL x86_64

Testing package set / solving RPM inter-dependencies…
###########
kernel-2.6.9-22.0.2.EL.x86_ ##########Done.
kernel-smp-2.6.9-22.0.2.EL. ########## Done.
Preparing ############ [100%]

Installing…
1:kernel-smp ########## [100%]
2:kernel #############[100%]
#

After doing this, you should verify /etc/grub.conf updated properly

# cat /etc/grub.conf
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/sda5
# initrd /initrd-version.img
#boot=/dev/sda
default=1
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Red Hat Enterprise Linux ES (2.6.9-22.0.2.EL)
root (hd0,0)
kernel /vmlinuz-2.6.9-22.0.2.EL ro root=/dev/sda5
initrd /initrd-2.6.9-22.0.2.EL.img
title Red Hat Enterprise Linux ES (2.6.9-22.0.2.ELsmp)
root (hd0,0)
kernel /vmlinuz-2.6.9-22.0.2.ELsmp ro root=/dev/sda5
initrd /initrd-2.6.9-22.0.2.ELsmp.img
title Red Hat Enterprise Linux ES (2.6.9-22.ELsmp)
root (hd0,0)
kernel /vmlinuz-2.6.9-22.ELsmp ro root=LABEL=/1
initrd /initrd-2.6.9-22.ELsmp.img
title Red Hat Enterprise Linux ES-up (2.6.9-22.EL)
root (hd0,0)
kernel /vmlinuz-2.6.9-22.EL ro root=LABEL=/1
initrd /initrd-2.6.9-22.EL.img
#

The default=1, will boot the second entry in the grub. First entry is 0. When u upgrade kernel, it will be added to top of grub.conf, in this upgrade, you will see two entry, first is normal kernel (position 0) and second is SMP kernel (position 1), we use default=1 as this is Intel(R) Pentium(R) 4 CPU 3.00GHz CPU and is HT, so two virtual CPU’s.

Related posts:

  1. HOW-TO: Upgrading Kernel with up2date
  2. Upgrading MySQL 4 to 4.1 in FreeBSD Cpanel Server.
  3. Upgrade Linux Kernel
  4. FreeBSD booting with different kernel
  5. Compiling FreeBSD Kernel with QUOTA for Cpanel