Recovering from mishandling the Gentoo sys-libs/ss and sys-libs/com_err block of sys-fs/e2fsprogs

April 10th, 2009

Worst case: a new admin didn’t read my previous not correctly, and in order to “resolve” the block unmerged ss and com_err without first fetching the new packages.  What do you do now?  You can’t rsync the files over from another server, nor does scp work.  A co-worker of mine used -pv instead of -av on his –featchonly emerge and ran into this problem.  I think he tried using a USB thumb drive to transfer the files as well, but either mount or the USB driver failed so even that didn’t work.  So what is one to do?  The solution is actually easier than I expected.  Unless you are very diligent about cleaning your machine, you probably still have copies of the old versions of the libraries on your system.  Type:

ls -l /usr/portage/distfiles/e2fsprogs*

This will give you a list of the versions of e2fsprogs you can install without downloading anything new.  If you are lucky, version 1.40.9 (or others) will still be there.  Then you can emerge the old versions back onto your system:

emerge -av –oneshot =sys-libs/ss-1.40.9 =sys-libs/com_err-1.40.9 =sys-fs/e2fsprogs-1.40.9

Other versions may work too, but this should get your system back into a state where you can do the –fetchonly of the new version and carry on with the upgrade.

Gentoo ss and com_err blocking e2fsprogs

December 1st, 2008

Gentoo appears to have released a change before releasing the portage that can handle it. If you emerge world right now, you’ll probably get a block involving sys-fs/e2fsprogs, sys-libs/ss and sys-libs/com_err. You’ll see something like this:
[blocks B ] sys-libs/e2fsprogs-libs-1.41.0)
[blocks B ] sys-libs/ss (is blocking sys-libs/e2fsprogs-libs-1.41.0)
[blocks B ] sys-libs/com_err (is blocking sys-libs/e2fsprogs-libs-1.41.0)

Normally, the solution to a block is to unmerge one of the offending packages, and re-emerge the other. DO NOT DO THAT here. PerGentoo Bug 234907 unmerging com_err will disable wget, which is what portage uses to download the package tarballs. So you won’t be able to re-emerge the e2fsprogs to get the libraries back. Again, per the bug, download all the necessary files first with the command:

emerge -avu --newuse --deep --fetchonly world

Then you can safely unmerge ss and com_err

emerge --unmerge sys-libs/ss sys-libs/com_err

and then update e2fsprogs:

emerge -av --nodeps sys-libs/e2fsprogs-libs sys-fs/e2fsprogs

According to the bug, portage-2.1.5 is able to resolve the block, but that is not yet stable so if you’re running in production you probably don’t want to run it yet. For now, these steps let you resolve it without issue.

OpenSSH 4.6 (and higher) problem with LDAP

November 22nd, 2008

At work we upgraded some of our server a while ago and ran into a problem when upgrading from OpenSSH 4.5 to 4.6. It just stopped working. We use LDAP authentication and It would log an error “‘user’ is not in ’sshgroup’”.

“id user” would confirm that they were indeed in sshgroup, and interestingly enough, adding them to a local group “sshgroup” would not help either.

I found a Gentoo Bug which provides some insight. It may be an x86_64 problem which has a patch in 4.7, but it is still happening on my servers in 5.1. In any case commenting out the LpkSearchTimelimit and LpkBindTimelimit configuration settings in /etc/ssh/sshd_config solved the problem for me.

The Server service hung on starting.

November 16th, 2008

For a couple of years now, one of my Windows XP workstations has taken about 10 minutes to start responding on the network. The 10 minutes would be spent trying to start the Server service. Then an error 7022 with a message “The Server service hung on starting.” would be entered in the System Event Log, the Server service would be restarted, and everything would be fine. Every now and then I’ve searched Microsoft Support to see if they had any suggestions but never found anything. I’ve also Googled it from time to time, and still no dice. I don’t know what made me decide to try once again, but I did today. While the search on MS still came up empty, Google once again came to the rescue. It was to a forum post which interestingly enough, contained a link to a MS KB article:

And here is a direct link to that article: http://support.microsoft.com/default.aspx?scid=kb;en-us;319127

In brief, some Lexmark and HP printer drivers install port monitoring software which in some undescribed fashion cause the Spooler service to try to start before the Server service. The solution is to make the Spooler service depend on the Server service so Spooler does not start until after Server. For more details go to the MS link, but if you know what you are doing, you can add lanmanserver to the DependOnService key in HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Spooler.

<rant>One of the most interesting things I find about this is that Google was able to to provide a link, but Microsoft Support search was not able to. The support.microsoft.com robots.txt file disallows search engines from crawling Knowlege Base articles. And the would be okay if their own search worked well, but in this case it totally failed even though the exact phrase clearly exists in the article.</rant>

Qmail on x86_84 softlimit error

August 22nd, 2008

I recently installed qmail (mail-mta/netqmail in Portage) on an Intel based server under x86_64 Gentoo. Everything seemed fine, but when qmail-smtpd tried to receive remote email, it would die with the following error:

2008-08-22 10:51:38.328444500 tcpserver: status: 1/40
2008-08-22 10:51:38 tcpserver: pid 5004 from 192.168.0.33
2008-08-22 10:51:38 tcpserver: ok 5004 franklin:192.168.0.4:25 newyork:192.168.0.33::4878
2008-08-22 10:51:38 /var/qmail/bin/qmail-smtpd: error while loading shared libraries: \
   libcom_err.so.2: failed to map segment from shared object: Cannot allocate memory
2008-08-22 10:51:38 tcpserver: end 5004 status 32512
2008-08-22 10:51:38 tcpserver: status: 0/40

Google didn’t show any association between libcom_err and qmail, but “failed to map segment” turned up other problems associated with softlimit.

The softlimit settings in qmail are in /var/qmail/control/conf-common. But they can be overridden in /var/qmail/control/conf-smtpd (since that was the only service which was having trouble). I added SOFTLIMIT_OPTS=”-m 32000000″, restarted the qmail-smtpd service, and it started receiving like a champ.

FireFox bug with onreadystatechange

May 24th, 2008

Just ran into this bug in FireFox: https://bugzilla.mozilla.org/show_bug.cgi?id=412112. Basically, if you do a synchronous call on an XMLHttpRequest object, the onreadystatechange function is not called. So the following code doesn’t work.

var request = new XMLHttpRequest();
request.onreadystatechange = function () {
if (request.readyState == 4)
  if (request.status == 200) alert('request successful')
};
request.open("GET", "/index.html", false); /* the false here makes it synchronous *
request.send(null);

Instead you must assume that the synchronous send has completed and instead check the status and process the response immediately. <edit> This means you do not need to define an onReadyStateChange function at all </edit> So:

var request = new XMLHttpRequest();
request.open("GET", "/index.html", false); /* the false here makes it synchronous */
request.send(null);
if (request.status == 200) { /* the request has been returned */
  alert("request successful")
}

This can actually be easier to code, but to me it was unexpected. I would expect that the
onreadystatechange be called when the response comes back either way. And if the synchronisity of the call is variable, it could get more interesting.

Recording The Daily Show on Tivo

May 13th, 2008

I just upgraded my Tivo to a Tivo HD (very cool) and lost the old tip on how to avoid recording 5 copies of The Daily Show every day. Apparently Comedy Central doesn’t provide enough metadata for the Tivo to figure out when an episode is new and when it is a rerun. This little trick was in a Tivo Newsletter:

WishList(r) Search Suggestion: De-dupe Your Now Playing List

Even more remarkable than the truth behind “My TiVo gets me” is the inspiring fact that many of you truly get the real genius of TiVo, and why a cable DVR couldn’t even begin to compare.

If you like The Daily Show with Jon Stewart, you know what happens when the show takes a week or two hiatus: Your DVR records lots of repeats because they stop listing the guests for each night. Why? When the networks don’t provide unique guide data, TiVo can’t determine if the show is new or a repeat, so it records them all to play it safe. Waste space and/or manual recordings no more! Martin T., from the Web’s most beloved TiVo community forum, exercised the new-and-improved TiVo WishList(r) feature to get us our daily Jon Stewart, without the three extra servings. Here’s how:

1. Go to Find Programs, and create a new WishList(r) search.
2. Enter the show title as your first Keyword: Daily Show with Jon Stewart.
3. Select “Done entering Keyword.”
4. Next, select Keyword again, this time entering the generic program description (the following is the generic descriptor for Daily Show): A humorous slant on top news stories.
5. Now give it a Thumbs down. (By default, your first Keyword gets a Thumbs up.)
6. Set the WishList to “Auto-record” with “First-run only.”
7. Delete the old Season Pass recording for Daily Show.

So what just happened? You’ve instructed your TiVo DVR to record all new episodes and ignore episodes with generic guide data. No more reruns. No more multiple recordings. And if two of your tuners are busy at airtime, TiVo will choose to record a later show. Ahhhh…

“In addition to working very well for The Daily Show and The Colbert Report,” explains Martin. “I use the above method for an ongoing ‘Amazing Race’ WishList search that will automatically record each new season, but ignore generic reruns, as well as ‘Saturday Night Live’ and ‘Conan O’Brien’ WishList searches that ignore generic, late-night reruns.”

IE vs FireFox: Using JavaScript to modify attributes

April 19th, 2008

I was working on an interesting little project involving the Google Website Optimizer and ran into this little gem.

The task was to use JavaScript to rewrite a page that was formatted using tables and was sometimes missing a row that spanned the whole table. Now I have to admit that I am not a JS or DOM pro, But I’ve picked up though some experience through this and a couple other tasks. So here is the base HTML:

<table id="table" border=1>
<tr id="leftcol">
<td>foo</td>
<td>bar</td>
</tr>
</table>

The goal is to make the DOM look like this:

<table border=1>
<tr>
<td colspan=2>colspan test</td>
</tr>
<tr>
<td id="leftcol">foo</td>
<td id="rightcol">bar</td>
</tr>
</table>

So the JavaScript is supposed to do that looks something like this:

<script>
var element = document.getElementById("rightcol");
var newrow = element.parentNode.parentNode.insertRow(0);
var newcell = newrow.insertCell(0);
newcell.innerHTML("colspan test");
newcell.setAttribute("colspan", "2");
</script>

I was developing it in FireFox thanks to the FABULOUS tool FireBug which lets me test the JS in a command line environment before actually storing it in a file but of course I had to test it in IE as well. The raw HTML file appears the same way (and correctly) in both browsers.

Raw HTML in IE

But when I add the JavaScript, I get differences when I check them in the browsers.

JavaScript updates in FireFoxJavaScript updates in IE

In IE, the colspan attribute didn’t seem to have an effect. Hmm, okay I will check with the IE Developer Toolbar which is no FireBug, but at least lets you see how IE is interpreting the code.
Raw HTML in IE

Okay, so the colspan attribute is set. So why isn’t it being applied??? Try resetting the attribute in the Developer Toolbar to “2″ by clicking on the value and then hitting <enter> (choose “This cell only”).

IE Developer Toolbar showing case sensitivity of attributes

Hmm, the result looks good, but there are TWO attributes, “colspan” and “colSpan”. So going back to the original HTML code, and looking at that in the Developers Toolbar shows that IE has converted the attribute to the appropriate case from the original HTML:

IE Developer Toolbar raw html

But that it doesn’t do that when the attribute is set through JavaScript.

I know you can use the JS object property (td.colSpan) to set the attribute as well which is a function, so well documented to be case sensitive, but my understanding has always been that HTML elements and attributes are not. Why does IE follow that in the HTML, but not in the JS functions that modify it? I don’t know. It seems silly to me.

John

One John’s problems

April 13th, 2008

I often run into interesting problems in my work and in my play.  But finding solutions on the web can be challenging.  So I decided to start recording them so that if somebody else ran into them as well they might find them.  For the record, I am currently using Gentoo Linux, Apache, MySQL, and Perl at work, so I expect most of the problems to be related to one or more of those systems.  Also, I am not a writer.  So don’t expect wonderful prose.  But please leave a comment if it helps or if you think more clarification is needed.