Always On (IRC)
Addicted to IRC?
Feel like you're missing out when you're not logged in?
You're not alone. But there is an answer! (And it's not a self-help group).
ZNC is an IRC bouncer. Basically, it stays permanently connected to the IRC servers; you connect to ZNC, and it re-plays any messages that were sent whilst you were disconnected.
ZNC: A quick installation guide
- Find a suitable server (something like a VPS which is permanently connected to the internet)
- Download the ZNC source-code
- Compile it
- Create a system-account to run the ZNC daemon
- Launch ZNC in configuration-mode (and setting the config-files to be stored somewhere sensible)
- Set up an init.d script to start/stop ZNC
- ???
- Profit! or something.
1. Find a suitable server
Personally, I use a single VPS node from VPS Net (mainly because I have a spare node, and I might as well use it for something, right?!)
Essentially, you want something that:
- is permanently connected to the internet.
- can access the IRC servers you want to access (i.e. can connect out on the relevant port - usually 6667).
- is accessible from your internet connection (using an arbitrary TCP port - you can configure this in the znc config).
2. Download the ZNC source
wget http://znc.in/releases/znc-0.098.tar.gz tar -xzf znc-0.098.tar.gz
3. Compile ZNC
cd znc-0.098 ./configure make sudo make install
4. Create a system-account
You would usually want ZNC to run under its own account, so it's somewhat isolated from the rest of your system.sudo useradd -r znc
znc:x:999:999::/home/znc:/bin/sh
5. Launch ZNC in configuration-mode
By default, ZNC tries to load its config from its home directory. We've created a system account, so there is no home directory...instead I create /etc/znc.d and stick the config in there.sudo mkdir /etc/znc.d sudo mkdir /etc/znc.d/conf sudo chown znc:znc -R /etc/znc.d sudo -u znc znc --makeconf --datadir=/etc/znc.d/conf
6. Set up an init.d script
Init.d scripts make it easy to start and stop the daemon (and allow it to run in the background). Here's my init.d script at /etc/init.d/znc:#!/bin/bash
## BEGIN INIT INFO
# Provides: znc
# Required-Start: $local_fs $network
# Required-Stop: $local_fs $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start ZNC at boot time
# Description: Enable ZNC IRC bouncer.
### END INIT INFO
DATADIR='/etc/znc.d/conf'
DAEMON_OPTS='--datadir='$DATADIR
start() {
echo -n "Starting : "
echo
start-stop-daemon --chuid znc:znc --start --exec /usr/local/bin/znc -- $DAEMON_OPTS
return
}
stop() {
echo -n "Shutting down : "
echo
start-stop-daemon --chuid znc:znc --stop --exec /usr/local/bin/znc -- $DAEMON_OPTS
return
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
*)
echo "Usage: {start|stop|restart"
exit 1
;;
esac
exit $?sudo update-rc.d znc defaults


Add new comment