Oct 8, 2013

[howto] recompile & modify ubuntu package

Since I had some problems with my ZNC IRC bouncer I decided to recompile it with the TCP feature KEEPALIVE. Before I compared ZNC and weechat behaviour and found out that weechat uses KEEPALIVE while ZNC does not. I hope this will solve my connection instability.

To change it on my ubuntu system I had todo the following steps. If you know the commands, it's quite an easy task :-)

Create a new directory and change to it:
mkdir znc
cd znc
Get the source code:
apt-get source znc
Get the tools needed to recompile:
sudo apt-get build-dep znc
Do your changes...

Goto to the source directory:
cd ~/znc/znc-1.0
Start recompilation:
sudo dpkg-buildpackage -rfakeroot -uc -b
If fakeroot is missing, get it and try again:
sudo apt-get install fakeroot
If the package is already installed, I think it is easiest to remove it (else you might get some errors about dependencies if the package consist of more .debs):
sudo apt-get remove znc
Change to the parent folder and install the newly compiled .debs:
sudo dpkg --install *.deb

That's it - enjoy :)

Update: My ZNC connection is not really more stable wth keepalive. keepalive usually takes more than 2 hours to be used.

Update 2: I fixed the connection issue by using a smaller timeout for the ZNC initiated ping. Might be that any device (probably provider) on the route kills connections that are just listening.