To create new wiki account, please join us on #znc at Libera.Chat and ask admins to create a wiki account for you. You can say thanks to spambots for this inconvenience.

FAQ: Difference between revisions

From ZNC
Jump to navigation Jump to search
From archive.org
 
>Wardmuylaert
Line 182: Line 182:
Here's simple workaround.
Here's simple workaround.


First, you should know number of wanted clients. Let's say that you want 3 clients: 1 xchat and 2 irssi-s. Let's say that your username is johnhoe.
First, you should know number of wanted clients. Let's say that you want 3 clients: 1 xchat and 2 irssi-s. Let's say that your username is johndoe.


Make following users: johndoe_ircd, johndoe_xchat, johndoe_irssi1, johndoe_irssi2. This naming scheme isn't strict - everything is up to you.
Make following users: johndoe_ircd, johndoe_xchat, johndoe_irssi1, johndoe_irssi2. This naming scheme isn't strict - everything is up to you.

Revision as of 11:00, 29 December 2011

If your question isn't answered here, feel free to /join #znc on EFNet to talk about this or any other ZNC related issues. We are happy to help wherever we can.

Compiling ZNC

General

The compiler dies saying it has not enough memory!

Starting from ZNC 0.062, you can use the --disable-optimization to configure. This will disable "-O2" and instead use "-O0". GCC should need less memory now.

If you still can't compile ZNC, try ./configure --disable-optimization CXXFLAGS="--param ggc-min-expand=2 --param ggc-min-heapsize=20000" but be prepared for looong wait.

configure: error: pkg-config could not find znc (znc.pc)

Use PKG_CONFIG_PATH=~/znc/lib/pkgconfig ./configure and replace ~/znc with the path you installed ZNC to.

Upgrading / updating from a previous release, to a new version

This is really simple. You can just follow the instructions on the Installation page again. Your configuration won't be deleted. If you'd like to make a backup before, however, you can backup ZNC's config folder. It is usually located at ~/.znc. You can use tar to make a backup, like this: tar cfvj znc-backup.tar.gz ~/.znc.

Do I have to shut down and restart ZNC during an upgrade to a new version?

Yes. You have to. There's no way to avoid it and also no feasible technical way to do it in a future version, sorry.

BSD

I get a "Need an operator" error when running make in bsd

Try using gmake instead.

ZNC crashes at making a config file or adding a user via webadmin on FreeBSD 7.x 64bit

Try to compile znc from source with g++42/gcc42 from the ports instead of the default gcc (./configure CXX=g++42) and check your compile output for g++42.

Debian

I'm getting the error: configure: error: C++ compiler cannot create executables

There are missing some compiler packages, you need to install them via:

sudo aptitude update 
sudo aptitude install build-essential make bin86

If you aren't on Debian, Ubuntu, or related distro, you need to install g++, make and possibly other things using your package manager.

I'm compiling under debian and I don't have an openssl/include directory available

Try using apt-get install libssl-dev to get the development version of OpenSSL. (Something similar may be the case for other distros with package managers.)

I've installed znc, but when i try to compile modules it says that there is no command znc-buildmod

You need to add the development files to your debian/ubuntu:

sudo aptitude install znc-dev

Starting ZNC

Why do I get an "Incorrect Password" every time I connect even though my pass is correct?

The best way to authenticate with ZNC is to supply both your user and pass as the server password separated by a colon like so.. "user:pass" (without quotes) Alternatively you can use the user portion of the identd info, but we don't recommend this method.

Also, make sure you did not accidentally load one of the saslauth or imapauth modules.

How can I restart ZNC automatically (in case of a machine reboot, crash, etc.)?

Add a cron entry to execute ZNC regularly. If there is already one copy of ZNC running on a particular config file, new copies won't be spawned. Example cron entry:

*/10 * * * *   /home/you/znc/bin/znc >/dev/null 2>&1

This will check if ZNC is running every 10 minutes. If you load a module (like away) that needs user input to run, you can add the input to the LoadModule line in your config file (ie. LoadModule = away yourpassword).

If you're using Vixie's cron, you can start it on start-up like this.

 @reboot your_username /home/you/znc/bin/znc >/dev/null 2>&1

Using ZNC

How do I tell ZNC which network/server a channel belongs to?

You don't. That's not how ZNC works (because the IRC protocol isn't capable of handling multiple servers in one connection and therefore no IRC clients can support it). You need to add one ZNC user per network. Please also read the next question.

How to use multiple networks like with psybnc?

ZNC works differently. One user represents one network. So you need to use a separate ZNC username for each network. You can have multiple ZNC users in one and the same config file, running in one and the same ZNC process.

See this feature request on sf.net for technical details.

If you make multiple users for multiple networks you can use the following mIRC script to make multiple connections to your bouncer:

on *:start: {
  server my.bouncer.net:6697 user1:password1 -i Nickname AltNick Email Fullname
  server -m my.bouncer.net:6697 user2:password2 -i Nickname AltNick Email Fullname
  server -m my.bouncer.net:6697 user3:password3 -i Nickname AltNick Email Fullname
}

Connections to ZNC using SSL:

on *:start: {
  server my.bouncer.net:+6697 user1:password1 -i Nickname AltNick Email Fullname
  server -m my.bouncer.net:+6697 user2:password2 -i Nickname AltNick Email Fullname
  server -m my.bouncer.net:+6697 user3:password3 -i Nickname AltNick Email Fullname
}

I added several different servers, but ZNC connects only to one of them!

You need to have separate user per IRC network (see previous question). Additional servers for the same user are for fallback. If one server doesn't work, ZNC tries to connect to another server. So you can add several servers of one network to server list of one user.

How do I add a new user?

There are (at least) three ways to add a new user.

The easiest way is to load and use the webadmin module.

If you want to do it from IRC, load the admin module and check out /msg *admin help.

It's not suggested if you are new to ZNC, but it's also possible to add a new user via the config file. To do that, edit znc.conf and add a new <User> section. After that, rehash ZNC by issuing /msg *status rehash from IRC or kill -SIGHUP `pidof znc` from the shell.

Connecting with mIRC

You can add your ZNC to the list of servers via the following command:

/server -a _IP_ -p _PORT_ -g gZNC -w _USER_:_PASSWORD_ -d ZNC

So for example:

/server -a 127.0.0.1 -p 12345 -g gZNC -w Test:123456 -d ZNC
/server -m ZNC

To connect with SSL first download and run the OpenSSL installer available here, then you can connect by adding a + sign before the port number, like this:

/server 127.0.0.1:+12345 username:password

Adding it your server list is as simple as:

/server -a 127.0.0.1 -p +12345 -g gZNC -w Test:123456 -d ZNC

Connecting with Eggdrop

Add this to your eggdrop configuration:

set servers {
    <server>:<port>:<user>:<pass>
}

I got banned from #channel and ZNC keeps trying to rejoin

Just do /part #channel and ZNC will remove the channel.

How to use the loaded modules?

/msg *modulename command

or

/znc *modulename command

"*" is the StatusPrefix, which you can change in config file. You could start trying the help command which should work on all modules.

I keep getting kicked for flood when I reattach bnc!

This happens if you use "many" channels, due to IRC clients flooding the server with commands upon reattach. There is no throttling/fix for this yet. A workaround is enabling keepbuffer and setting some lines of buffer for each channel. (You should experiment how many is enough.)

Every time I connect to my BNC, I see the channel buffers from the last time I connected!

If you have a large channel buffer, it may be annoying to see the channel buffer every time you reconnect. To have ZNC erase the channel buffer every time you connect, set:

KeepBuffer = false 

using the webadmin module, or in the configuration file.

This will result in only the missed messages being played back to you upon reconnecting. Be careful if you use more than one client as znc will still see you as connected when one drops off and messages will not be buffered. Also, if your connection to znc dies unnaturally, znc might take a little bit to realize you're gone and thus not buffer a few of the messages that you haven't yet seen.

What are VHOSTS and why can't I make mine work?

ZNC VHOST option controls the IP address ZNC will attempt to make connections to the IRC servers from. For this to be successful the computer you're running ZNC on must have this IP address configured and usable for your user. For it to show up as a host name on IRC there must be matching forward and reverse DNS in place. You can check this with:

% host demo.znc.in
demo.znc.in has address 208.84.148.90
% host 208.84.148.90
90.148.84.208.in-addr.arpa domain name pointer demo.znc.in.

As long as the response looks similar then you should be able to

/msg *status SetVHost 208.84.148.90

connect to IRC and check that it's working.

If you find you are unable to connect to IRC after attempting to set VHOST options then it is likely you have set an IP address or host name that is not available on your computer. The easiest way to resolve this and get connected to IRC is to

/msg *status ClearVHost

and try to connect again.

To get ride of several missunderstandings vhost was renamed to bindhost since version 0.096.

I get 'Could not find znc-config. Please (re)install' when using znc-buildmod

If you manually provided a --prefix option when building znc then you will need to ensure that this prefix is in PATH. For example, if you did

./configure --prefix=$HOME/local

you will need to ensure that

echo $PATH

includes $HOME/local/bin (expanded to your home dir, not literally $HOME). If it doesn't then a quick, one-time fix is to type

export PATH=$HOME/local/bin:$PATH

and retry. You can also put the above line into your ~/.profile or ~/.bashrc so it gets set when you login.

I keep getting a lot of stuff like /who replies when connected with multiple clients to one znc-user

see user-module Route_replies

How can I access webadmin with my browser?

By default web UI runs on the same port as your znc is accessible.

Note: If znc listens using SSL, try https:// instead of http://

My IRC-Client doesn't allow multiple connections to one server/host

Try to use different local aliases for the bnc-host.

How to reload ZNC config without restart?

The best way is NOT to change znc.conf and other files manually while ZNC is running. Try to use webadmin or admin instead, or use /msg *status help

If you really need to rehash config from file, there're 2 ways to do that: from IRC (/msg *status rehash) and from shell (pkill -SIGHUP znc).

[10053] Software caused connection abort

Socket error 10053 can be caused by attempting to connect without SSL to a znc bouncer with SSL enabled (or vice versa). Refer to your IRC-client's documentation on how to establish a SSL-secured connection to a server.

How to store private messages even when user is attached, so other clients can see them?

Here's simple workaround.

First, you should know number of wanted clients. Let's say that you want 3 clients: 1 xchat and 2 irssi-s. Let's say that your username is johndoe.

Make following users: johndoe_ircd, johndoe_xchat, johndoe_irssi1, johndoe_irssi2. This naming scheme isn't strict - everything is up to you. Set StatusPrefix for "client users" to something else, for example ^, because otherwise you won't be able to speak to both *status-es.

Connect user johndoe_ircd to IRC server. Connect users johndoe_xchat, johndoe_irssi1 and johndoe_irssi2 to 127.0.0.1 to the same ZNC, to user johndoe_ircd.

Connect xchat to johndoe_xchat, and irssis to johndoe_irssiN.

xchat -----> ZNC,johndoe_xchat -----------\
                                           v
irssi1 -----> ZNC,johndoe_irssi1 -----> ZNC,johndoe_ircd -----> IRC server
                                           ^
irssi2 -----> ZNC,johndoe_irssi2 ---------/

This way, every private message that johndoe_ircd gets, is sent to all "client users", and they remain in those buffers until that client reads them.