yum — priorities matters

One of the most commonly asked questions in the CentOS forums is concerned with 3rd party repositories. In addition to referring to the Repositories wiki article, we need to make sure people use the yum priorities plugin appropriately.

Often times, we want to know how they set up the priority scores but there is no easy way to display them. yum repolist all does not include this info. A forum helper jlehtone posted a one-liner that does just that:

cat /etc/yum.repos.d/*.repo | sed -n -e "/^\[/h; /priority *=/{ G; s/\n/ /; s/ity=/ity = /; p }" | sort -k3n

The output may look like this:

priority = 10 [base]
priority = 10 [updates]
priority = 30 [extras]
priority = 50 [centosplus]
priority = 60 [c5-testing]
priority = 70 [rpmforge]
priority = 75 [kbs-CentOS-Testing]
priority = 90 [kbs-CentOS-Misc-Testing]
priority = 94 [epel]

Almost immediately after the above post, Alan the perfectionist, a cat person himself, opposed the use of over-working cats and came up with his version of the one-liner:

sed -n -e "/^\[/h; /priority *=/{ G; s/\n/ /; s/ity=/ity = /; p }" /etc/yum.repos.d/*.repo | sort -k3n

Personally … I want to see the cats working for the community … :-D

yum — when all is not all

A while ago, I was talking with my buddies and the subject was about installing / updating a package using yum.  yum did not find the package that had just been added.  No problem, either yum clean metadata or yum clean all will do.  Err … it didn’t. 

As it turned out, it didn’t work because the repository in question was disabled by default.  The man page for yum clearly states:

Note that "all files" in the commands below means "all files in currently enabled repositories".   If you  want  to  also clean  any  (temporarily)  disabled  repositories you need to use --enablerepo=’*’ option.

Getting rid of Suspend on a desktop machine

For some reason, my desktop gnome menu had a “Suspend” option.  It was right under the “Log out …” option in the System dropdown menu.  One day, when I meant to click on the “Log out” option, my mouse went too far and I ended up selecting this “Suspend” option.

After struggling for the next few minutes, I gave up and rebooted the machine to come out of the suspended state.

The Suspend option should not have been there to begin with.  Anyway, it was time to remove it.  Fortunately, that was as easy as typing [1]:

gconftool-2 --type boolean --set /apps/gnome-power-manager/can_suspend false

Likewise, if you want to get rid of the Hybernate option,

gconftool-2 --type boolean --set /apps/gnome-power-manager/can_hibernate false

[1] http://magazine.redhat.com/2008/05/30/tips-and-tricks-how-do-i-remove-the-suspendhibernate-entries-from-the-system-menu-in-the-gnome-panel/

Strip it – but not all of it

My first encounter with kernel modules was when my systems running Fedora Core 5 started crashing after the kernel update to 2.6.18.  Long story short, it was due to a bug in the cifs kernel module which was fixed after more than 100 e-mail exchanges with samba developers.  The problem was solved, but there was something I never understood; the patched cifs module I built was much larger than the distro’s.  This is always true.  A custom-built version can be more than 10-times larger than its counter part in the distro kernel.

I never pursued this issue until the other day when wolfy and Ned started a conversation on IRC about this size difference.  It is not due to stripping because the distro version is “not stripped” and, in fact, if you strip it the module no longer loads.

Then later, Alan asked in his clever voice, “have you checked the options to strip?  It might be that a total strip is verboten but a selective strip works?”

That was it! :-)

I tried a strip --strip-unneeded command and that reduced the size of my module file to something close to the distro’s AND the file remained “not stripped“.  Soon after, Ned found the --strip-debug option does the trick, too.  This is probably what is used when the kernel is built and modules compiled.

Mystery solved.

Search is ON — Getting help for CentOS

There are several ways of getting help in CentOS as summarized on the Wiki Help page. The most commonly used CentOS-provided venues are the mailing lists and the forums. However, when people encounter problems or simply want to find out some information, they most likely just go to google.

I performed some searches on google for commonly used terms with the “site:centos.org” added and then counted the number of hits that pointed to the mailing lists (M/L) and did the same for the forums.  The result is summarized below. Assuming most people will not go through many pages, I collected the results from the first 50 links (that’s 5 pages with the default of 10 per page).


Search term   M/L Forums
============  === ======
install         0   21
installation    0    4
kernel         10   11
driver(s)       3   24
DNS            11   29
postfix        19   20
sendmail       22   16
selinux         5   10
apache          0   23
httpd           6   30
xen            38    7
kickstart      20   12
crash          16   11
panic          10   19

While I do not claim this is a representative result, I do notice that the forum posts tend to be found more often than the M/L posts. One notable exception (among this small set of searches) was “xen” — most of them were from the centos-virt mailing list (what else do you expect? :-) ).

Also, I am not trying to compare the significance/importance of the two help channels, either. I only want to emphasize the fact that, in the age of google everything, many users come to read those posts and, therefore, we need to maintain the contents of the posts as accurate as we can.

I’ve heard about a plan to merge postings from both channels into a single database.  That would become a valuable souce for all CentOS users.

C-e-n-t-O-S, it’s an Enterprise class Linux distribution

Last year, we saw many people who migrated to CentOS. There is no doubt we have many more CentOS “newcomers” this year. There are basically two types of CentOS newbies.

One is former/current Windows users who just want to see what Linux looks like or who are seriously considering saying goodbye to the blasted OS. These people need a lot of help but, as far as they are eager to learn, it’s not difficult to provide assistance.

The other type is those who have been using other distros for some time. They tend to demand the latest and the greatest version of everything. It is often necessary to explain all about an enterprise-class distro, stability and backporting. A recent post in the CentOS forum is from a person of such type:

“I guess I will go with a more updated and modern O/S.
Centos must be years behind other O/S”

Another concept that is often not so obvious among the CentOS newcomers is the package-based management. As soon as they find out their favorite application is not available or obsolete, they want to install it from source. Let me pull some example again from a recent post in the forums (with a slight adjustment):

“I was thinking removing the original version (e.g. yum remove glibc) and install the new version using /usr/local as the root path could be a better solution for the system stability.”

This poster is even talking about the stability ! However, this is not a laughing matter. We should all get busy and provide proper guidance to people who are serious about doing the migration.

Welcome to the CentOS community !

Good, old holiday cheers

Jim Perrin put an impressive ASCII Christmas tree on Planet CentOS.  This reminded me of my own very old ASCII snowman I used to place in motd of a Solaris workstation during holiday seasons.

-rw-r-----   1 yagi2    yagi         661 Dec 17  1998 holi

$cat holi

                _XXX_      .    .       .  .    .  .   .     .  .
               / """ \    .    .    .   .      . .    .   .      .
              {  0 0  3         .  .     .     .     .        .
              {   <   3    .  .    *** HAPPY HOLIDAYS ***   .   .
               \  V  /      .  .  .  .    .   .    ..   .   . .   .
               &&&&&&&    ..   . .     .     .  .     .     .   .
              /    &  \       .    ..    .  .  .   .    .     .
             /    &    \    .   .     .    .  .  ..    .   .    .
            BB   &    )))     .   .      .     .    .     .  .     .
            \          /
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Clean that Inbox

Like many other people, I use Linux as a backup server.  The other day, I noticed that daily incremental backup of one of the Windows machines was well over 1 GB even on the day the user was mostly idle.  The only thing the user was doing was … e-mailing.  Aha! (heard the bell?)  It must be that inflated Inbox.

Mozilla-based mail clients like Thunderbird and Seamonkey mail do not physically remove messages that user deletes.  Instead they are only tagged “deleted”.  This is true even after the Trash folder is emptied.  The [supposedly] deleted mails get [really] deleted when Inbox (or any folder for that matter) is compacted.

I went to the blasted machine and did just that and the Inbox went from > 1 GB to a fraction of its original size.

Of course, this is not just Windows.  Huge mail folders can potentially cause trouble and also degrade the performance of the client.  The best strategy to prevent this is to set up an automatic clean up.  In Thunderbird, go to Edit -> Preferences -> Advanced -> Network & Disk Space and then enable the “Compact folders when it will save over…KB” option.

Getting kino to work on CentOS-5

One of the many things I use Linux for at work is to edit movies.  No, not that kind of movies you are thinking about … this is strictly for science work.  Anyway, the first step is to transfer video from a camcorder connected through a firewire port using kino.  I am doing this on a machine running Fedora Core 6.  I attempted to do the work on a CentOS-5 box.  However, going to the capture mode on kino produces an error:

*raw1394 kernel module not loaded or failure to read/write .....

Long story short, this is a known issue, and the kino web site offers a couple of workarounds. I am going to summarize a CentOS version of these workarounds.

Method 1 — requires a kernel from the centosplus repository

(1) Edit /etc/modprobe.d/blacklist-firewire and comment out blacklist firewire-ohci
(2) Reboot
(or run modprobe firewire-ohci to achieve the same without reboot)
(3) Connect the camcorder
(4) Step (3) creates /dev/fw? (? = 0, 1, etc). Change the owner to the logged-in user.
(5) Start kino and go to Capture. Press the Capture button.

Method 2 — Use if Method 1 does not work

(1) Install ieee1394 from the ATrpms repository. Refer to the CentOS Wiki Repository article for the instruction.
(2) Download the kmod-ieee1394 package frpm the ELRepo repository and install it using the rpm -Uvh command. There is no need to reinstall this kernel module upon kernel update.
(3) Download packages libraw1394_8 and libraw1394 from my collection and install them as in (2).
(4) Edit /etc/modprobe.d/blacklist and add these lines:
blacklist firewire_core
blacklist firewire_ohci

(5) Reboot
(6) Chenge the ownership of /dev/raw1394 to the logged in user.

Counting [on] CentOS Wiki

CentOS Wiki is filled with information and is one of the most frequently used resources available to CentOS users. But, little known is its statistics page:

http://wiki.centos.org/PageHits

According to Ralph, this page is created through a macro called “PageHits” but not all the details as to how this works are known. Anyway, let’s take a look at some of the top entries as of Dec 05, 2008.

This page shows how often a page was requested since the beginning of
logging. It has no intelligence, every view counts as hit.

 1. 732352 FrontPage
 2. 268550 HowTos
 3. 263042 Repositories
 4. 217961 Repositories/RPMForge
 5. 158478 TipsAndTricks
 6. 136617 FAQ
 7. 112780 HowTos/JavaOnCentOS
 8. 105514 FAQ/CentOS5
 9. 104275 HowTos/Xen/InstallingCentOSDomU
10. 102457 Repositories/CentOSPlus
11.  88726 Manuals/ReleaseNotes/CentOS5.1
12.  77033 Manuals/ReleaseNotes/CentOS5.0
13.  64338 PackageManagement/Yum
14.  64289 HowTos/Custom Kernel
15.  59413 HowTos/I need the Kernel Source
16.  58947 PackageManagement/Yum/Priorities
17.  57351 Manuals
18.  56419 Manuals/ReleaseNotes/CentOS5.2
19.  54229 HowTos/FreeNX
20.  49854 HowTos/PackageManagement/YumOnRHEL
21.  48016 FAQ/General
22.  42976 TipsAndTricks/NTFSPartitions
23.  42750 HowTos/Network/IPTables
24.  41817 TipsAndTricks/YumAndRPM
25.  41442 RecentChanges
26.  40885 HowTos/Nagios
27.  40669 GettingHelp
28.  40373 HowTos/Subversion
29.  37791 TipsAndTricks/WindowsShares
30.  30907 TipsAndTricks/Xen
32.  28906 TipsAndTricks/KickStart
33.  28127 FAQ/CentOS4
34.  27719 HowTos/MigrationGuide/ServerCD 4.4 to 5
35.  27660 Manuals/ReleaseNotes/CentOS5.1/Japanese
36.  26997 TipsAndTricks/VMWare Server
37.  26659 HardwareList


no intelligence … Hmmm, sounds familiar?  Let’s do some analysis. Not so surprisingly, the FrontPage is by far the most often visited page. Also, I knew that the Repositories article was very popular, and that indeed seems to be the case. Things like FAQ or ReleaseNotes are expected to get a lot of hits. What was interesting to me (as a Japanese) was that, among the localized ReleaseNotes, the Japanese version ranked No,1.  This is either because there are so many CentOS users in Japan or the Japanese people do not want to read English (or both).

The kernel-related pages are also well visited despite the fact custome kernels are not supported by the CentOS team.  Alan‘s efforts among others are well paid for.  Ned‘s IPTables is quite popular, too.  Note this page is relatively young compared to others.

My own small contributions, NTFS and WindowsShares, are listed there indiating a good number of CentOS users still stuck with the other OS.