Gentoo gettext upgrade: access violation

While trying to upgrade gettext to version 0.18.2 on Gentoo I was greeted with this error after the configure phase:

>>> Source configured.
* --------------------------- ACCESS VIOLATION SUMMARY ---------------------------
* LOG FILE: "/var/log/sandbox/sandbox-16125.log"
*
VERSION 1.0
FORMAT: F - Function called
FORMAT: S - Access Status
FORMAT: P - Path as passed to function
FORMAT: A - Absolute Path (not canonical)
FORMAT: R - Canonical Path
FORMAT: C - Command Line

F: open_wr
S: deny
P: /proc/self/coredump_filter
A: /proc/self/coredump_filter
R: /proc/26540/coredump_filter
C: java -version

F: open_wr
S: deny
P: /proc/self/coredump_filter
A: /proc/self/coredump_filter
R: /proc/26563/coredump_filter
C: java conftestver
* --------------------------------------------------------------------------------

The solution was fairly simple:

/usr/bin/java is a symlink to a JRE which was set up manually.

mv /usr/bin/java /usr/bin/DONOTUSEJAVA

emerge -uv gettext

mv /usr/bin/DONOTUSEJAVA /usr/bin/java

Ubuntu frustrations

I'm installing an Ubuntu 10.04 server at work. Because of proxy and internet configurations I'm installing packages from the CD instead of using the online repo's. No problem, I've done this before on virtual test machines without internet connectivity, it worked flawlessly.

Only those machines were 8.04. Not 10.04.

First problem: apt-cdrom add. For some reason it insists that the cd-rom can be found on /dev/sr1. Why it ignores /dev/sr0, which is where the cd-rom actually lives, is beyond me. The solution to this one is to configure a mountpoint in /etc/fstab (to /mnt/cdrom or so), and use

apt-cdrom -d /mnt/cdrom add

If you're lucky, apt will mount the cd-rom in /media/apt. If not, try a few more times until it works. If it's going to ignore the mountpoint anyway, shouldn't I be able to just tell apt-cdrom what device to use instead of what mountpoint?

Of course, after commenting out the online repos in /etc/apt/sources.list and running apt-get update, installing packages still doesn't work. No sirree, that would be too easy.

Failed to fetch cdrom:[Ubuntu-Server 10.04.2 LTS _Lucid Lynx_ - Release amd64(20110211.1)]/pool/main/p/patchutils/patchutils_0.3.1-2build1_amd64.deb File not found

And so on and so forth... not a single file can be cound, even though they do exist under /media/apt/pool/main/blablablablabla. You know, the point where apt actually mounted the cd-rom while ignoring my mountpoint?

The solution turns out to be really simple:

ln -s /media/apt /cdrom

Yes, you need a /cdrom directory or symlink in which the files on the cd-rom can be found, because the configured mountpoint in /etc/fstab and the one apt chose all by itself aren't enough.

User-friendly distro my ass...

pear behind a proxy server

So it turns out that pear (PHP Extention and Application Repository - http://pear.php.net ) completely ignores the $http_proxy environment variable:
hostname:~ # pear install HTML_Template_IT
No releases available for package "pear.php.net/HTML_Template_IT"
Cannot initialize 'channel://pear.php.net/HTML_Template_IT', invalid or missing package file
Package "channel://pear.php.net/HTML_Template_IT" is not valid
install failed


Pear has its own configuration, complete with proxy server setting:

hostname:~ # pear config-show
Configuration (channel pear.php.net):
=====================================
Auto-discover new Channels auto_discover
Default Channel default_channel pear.php.net
HTTP Proxy Server Address http_proxy


So once that is updated with the system proxy server, everything works just fine:
hostname:~ # pear config-set http_proxy $http_proxy
config-set succeeded
hostname:~ # pear install HTML_Template_IT
WARNING: channel "pear.php.net" has updated its protocols, use "channel-update pear.php.net" to update
downloading HTML_Template_IT-1.3.0.tgz ...
Starting to download HTML_Template_IT-1.3.0.tgz (23,309 bytes)
........done: 23,309 bytes
install ok: channel://pear.php.net/HTML_Template_IT-1.3.0


Grub not loading after upgrade from Vista to Windows 7

On my work laptop, I dual-boot Windows Vista Enterprise (in case it's necessary at a customer site) and Gentoo (if I get to do things my way ;-) ). I recently decided to upgrade Vista to Windows 7, which worked just fine (after installing a meeljon updates - it had been a while).

As expected, Windows 7 obliterated my MBR. Bye-bye GRUB, Gentoo LiveCD to the rescue!

In the livecd I mounted my / (on /dev/sda3), /proc and /dev to /mnt/gentoo and chrooted in:

# mount /dev/sda3 /mnt/gentoo

# mount -t proc none /mnt/gentoo/proc

# mount -o bind /dev /mnt/gentoo/dev

# chroot /mnt/gentoo /bin/bash

Now run grub, let it re-write itself to the MBR and everything's happyhappy-joyjoy again, right?

# grub

grub> root (hd0,2)

grub> setup (hd0)

grub> quit

# reboot

Right after POST, I get greeted by a blinking cursor, and that's it. No GRUB, no message, nothing. Just that blinking cursor, mocking me. Back to the livecd, and chrooting into my gentoo installation once again. I used to use grub-install, so I decided to try that again (important: after chrooting - it's not necessary but the command is different!)

# grub-install /dev/sda

/dev/sda does not have any corresponding BIOS drive

Apparently GRUB doesn't have a proper device map. Time to refresh it:

# grub-install --recheck /dev/sda

/dev/root: not found or not a block device

This one is new ... df -h reveals that / is mounted as /dev/root, instead of the expected /dev/sda3 and that /dev/root does not exist (of course - that bind command I used right before chrooting? /dev/root didn't exist in the livecd environment). A symlink ought to fix this:

# ln -s /dev/sda3 /dev/root

# grub-install /dev/sda

One reboot later my grub is back where it's always been, offering me the choice between Gentoo and Windows 7.

Error: Could not stat() command file '/var/lib/nagios3/rw/nagios.cmd'!

I ran into this error while messing around with nagios. Manually playing around with on /var/lib/nagios3/rw/nagios.cmd and its containing directories didn't seem to help much, so I went a-googlin'.

Here is the solution.

In short: (in case that blog goes down and I need it again ;-) ) :

sudo /etc/init.d/nagios3 stop
sudo dpkg-statoverride --update --add nagios www-data 2710 /var/lib/nagios3/rw
sudo dpkg-statoverride --update --add nagios nagios 751 /var/lib/nagios3
sudo /etc/init.d/nagios3 start

Gentoo: com_err and ss blocking e2fsprogs

After running into this on three computers, I figured I'd mention it here as well. It's a rather old issue by now, but at a certain point com_err and ss were moved to e2fsprogs on Gentoo. I found my workaround here : www.odi.ch/weblog/posting.php

Make sure not to unmerge com_err and ss before doing emerge -fuD world first!

Also, I had my "emerge" aliased to "sudo emerge". That won't work, because sudo also relies on com_err, which is unmerged at a certain point. Make sure you're logged in as root for this procedure.