Znc /


Patched Source

Upstream Source

You can choose to use the upstream source code, but you must apply patches to get it to build properly.

WARNING: If you are on OpenBSD 7.5, you must patch znc-1.9.0 to avoid a threading bug that causes segfaults and to fix a bug in the schat module.

First, download the latest stable release:

$ cd ~
$ ftp https://znc.in/releases/znc-1.9.0.tar.gz

We recommend you verify the gpg signature:

$ doas pkg_add gnupg
$ ftp https://znc.in/releases/znc-1.9.0.tar.gz.sig
$ gpg --recv-key D5823CACB477191CAC0075555AE420CC0209989E
$ gpg --verify znc-1.9.0.tar.gz.sig znc-1.9.0.tar.gz

Next, extract and unzip? the files:

$ tar xvzf znc-1.9.0.tar.gz 


Due to a bug in OpenBSD 7.5, we have applied a custom patch to ZNC to avoid segfaults on multicore servers:

diff -u -r znc-1.9.0-old/src/main.cpp znc-1.9.0-new/src/main.cpp
--- znc-1.9.0-old/src/main.cpp  Wed Feb 21 18:23:17 2024
+++ znc-1.9.0-new/src/main.cpp  Mon May 27 12:36:48 2024
@@ -292,6 +292,7 @@

 int main(int argc, char** argv) {
+    pthread_attr_t a; pthread_attr_init(&a);
     CString sConfig;
     CString sDataDir = "";

IRCNow provides a patched version of ZNC:

$ cd ~
$ ftp https://ircnow.org/software/znc-1.9.0a.tar.gz

On OpenBSD, ftp? can also be used to download files from the web.

For tar?, the options xvzf stand for e(x)tract, (v)erbose, un(z)ip, and (f)ile.

$ tar xvzf znc-1.9.0a.tar.gz

Chroot script

We also added the following chroot.sh script to make it easier to build chroots for ZNC: