Byobu (Advanced GNU Screen) under Centos 5/Python 2.4

I recently discovered Byobu, which is a set of scripts that lets you use GNU Screen more easily. If you spend a lot of time ssh’d into a server, you should definitely check it out. It worked fine on my desktop machine, but on my Centos 5 server, not so much. I did a little research and I found there were two problems.

The easy problem was keeping F2-F4 from working. The trick is that /etc/screenrc has the following line in it:

termcapinfo xterm 'k1=\E[11~:k2=\E[12~:k3=\E[13~:k4=\E[14~'

Commenting out the line make the function keys work! That was easy.

The 2nd problem was that F9 was not bringing up the menu. Well, most of the time. Sometimes you could get a peek of a Python traceback and sometimes — not often — it would work. The real puzzle was that if you started byobu-config from the command line it worked fine.

It turns out Centos has Python 2.4 which is pretty old. I intercepted stderr from the script and found out that a command that was reading from a pipe was returning “System Call Interrupted.” This isn’t really an error, but this version of Python apparently thinks it is. So sometimes, that signal wouldn’t interrupt the pipe and it would work.

I tried installing Python 2.6 but there are a lot of dependencies in Centos on Python and although I found someone with a “parallel” RPM it didn’t have the necessary libraries and I finally gave up. But then it hit me. If I could just pause a bit before the offending pipe, the signal would come in — not interrupt the pipe — and then all would be well. It seems to work!

Here’s the fix:

if os.path.exists("%s/.%s/disable-autolaunch" % (HOME, PKG)):
return 0

The script already imports time, so that wasn’t a problem. Problem solved. I like Byobu!

One thought on “Byobu (Advanced GNU Screen) under Centos 5/Python 2.4

Leave a Reply