home | links | feminist | studies | wishlist | cooking | !blog

Otrdecoder Issues on Debian GNU/Linux 4.0 (etch/stable)

onlinetvrecorder

The GNU/Linux versions of otrdecoder have always been a strange hack, and the latest static multi format binary is no different: it is quite picky about where it runs, as I had to learn the hard way.

$ otrdecoder
FATAL: kernel too old
Segmentation fault (core dumped)

Firstly it refuses to run on 2.4 kernels, which is all I need on my server; this is bad enough, but since I do have a workstation with a 2.6 series kernel, I hoped I could get away trading comfort for functionality. Not so, the binary did run (and even managed to load the name service libraries, which in itself seems bad behaviour for a statically linked program), but immediately complained that it could not connect to the server.

$ otrdecoder  -e user -p pass -q -i file.otrkey
Error: No connection to server!

An /etc/hosts entry didn't help, in fact no DNS request was made anyway. strace indicated that otrdecoder prefers to use nscd (none of the backups worked), so I reluctantly started it (I tend to dislike the service - I usually have a caching bind nearby, so ...). The strace output was different and slightly confusing:

connect(4, {sa_family=AF_FILE, path="/var/run/nscd/socket"}, 110) = 0
send(4, "\2\0\0\0\20\0\0\0\t\0\0\0http/tcp\0", 21, MSG_NOSIGNAL) = 21
poll([{fd=4, events=POLLIN|POLLERR|POLLHUP, revents=POLLIN|POLLERR|POLLHUP}], 1, 5000) = 1
read(4, 0xbff7a608, 24)                 = -1 ECONNRESET (Connection reset by peer)

nscd didn't seem to like the services request for the port of http/tcp, which is not particularly astonishing: up to Glibc 2.3, the only services supported were (quoting from /etc/nscd.conf) passwd, group, hosts ... nscd even complains politely about entries asking it to cache /etc/services:

# nscd -d  
11080: database services is not supported

The right thing (tm) would probably be to compile a static nscd package from glibc 2.4 or higher (in fact, Debian GNU/Linux never included 2.4, which seems to have been too volatile even for experimental ...), but I prefer cheap thrills

cd /tmp
wget http://ftp.at.debian.org/debian/pool/main/g/glibc/nscd_2.6.1-1+b1_i386.deb \
http://ftp.at.debian.org/debian/pool/main/g/glibc/libc6-i686_2.6.1-1+b1_i386.deb
ar x nscd_2.6.1-1+b1_i386.deb
tar -xzvf data.tar.gz
ar x libc6-i686_2.6.1-1+b1_i386.deb
tar -xzvf data.tar.gz

And, as root

# cat >> /etc/nscd.conf <<EOF
	enable-cache            services        yes
	positive-time-to-live   services        28800
	negative-time-to-live   services        20
	suggested-size          services        211
	check-files             services        yes
	persistent              services        yes
	shared                  services        yes
	max-db-size             services        33554432
EOF
# /etc/init.d/nscd stop
Stopping Name Service Cache Daemon: nscd.
# cd /tmp
# LD_LIBRARY_PATH=lib/i686/cmov/ lib/i686/cmov/ld-2.6.1.so ./usr/sbin/nscd -d

Astonishingly, this worked and otrdecoder now managed to phone home as intended:

$ otrdecoder  -e user -p pass -q -i file.otrkey
Progress: 100%