Difference between revisions of "Znc"

From ArchWiki
Jump to: navigation, search
(Storing ZNC's datadir in /etc doesn't follow FHS)
Line 7: Line 7:
 
By default, ZNC does not include an daemon init script (like those usually found in {{ic|/etc/rc.d/}}). It maybe preferable to run ZNC as a daemon:
 
By default, ZNC does not include an daemon init script (like those usually found in {{ic|/etc/rc.d/}}). It maybe preferable to run ZNC as a daemon:
  
1. Install and create a config as normal:
+
1. Install:
  
 
   pacman -S znc
 
   pacman -S znc
  znc --makeconf
 
  
2. Move the generated config to a global directory:
+
2. Create a znc group and user
  
   mkdir /etc/znc
+
   groupadd -r znc
   mv /home/$USER/.znc/* /etc/znc/
+
   useradd -r -g znc -d /var/lib/znc -s /bin/false -c znc znc
   rm -rf /home/$USER/.znc
+
   chown znc:znc /var/lib/znc
  
3. Create a new system user account
+
3. Install rc.d and conf.d script:
  
   useradd --system --no-create-home --user-group znc
+
   wget -O /etc/rc.d/znc https://raw.github.com/kylef/ark/master/znc-system-wide/znc.rcd
 +
  wget -O /etc/conf.d/znc https://raw.github.com/kylef/ark/master/znc-system-wide/conf.rcd
  
4. Apply the correct permissions to the configuration directory
+
4. Generate ZNC config:
  
   chown -R znc:znc /etc/znc
+
   rc.d makeconf znc
  
5. Copy the prepared [https://gist.github.com/1266098 init script] to {{ic|/etc/rc.d/znc}} and make it executable
+
To make ZNC start on boot, add ZNC to <code>DAEMONS</code> in <code>/etc/rc.conf</code>.
  
  cd /etc/rc.d
+
Start and stop the ZNC daemon as usual by running:
  wget https://raw.github.com/gist/1266098/b5530ead3f797ef344fb0e0cba16d270281d087b/znc
+
  chmod +x znc
+
  
6. Add znc to the [daemons] section in '''/etc/rc.conf'''.
 
 
Start and stop the ZNC daemon as usual by running:
 
 
   rc.d {start|stop|restart} znc
 
   rc.d {start|stop|restart} znc
  
Line 40: Line 35:
  
 
* [http://wiki.znc.in/ZNC ZNC (website)]
 
* [http://wiki.znc.in/ZNC ZNC (website)]
* [http://doomclaw.de/index.php/2009/08/18/run-znc-at-boot-with-an-init-script/ Init script guide]
 

Revision as of 01:29, 15 August 2012

ZNC is an advanced IRC bouncer that is left connected so an IRC client can disconnect/reconnect without loosing the chat session.

Init script

By default, ZNC does not include an daemon init script (like those usually found in /etc/rc.d/). It maybe preferable to run ZNC as a daemon:

1. Install:

 pacman -S znc

2. Create a znc group and user

 groupadd -r znc
 useradd -r -g znc -d /var/lib/znc -s /bin/false -c znc znc
 chown znc:znc /var/lib/znc

3. Install rc.d and conf.d script:

 wget -O /etc/rc.d/znc https://raw.github.com/kylef/ark/master/znc-system-wide/znc.rcd
 wget -O /etc/conf.d/znc https://raw.github.com/kylef/ark/master/znc-system-wide/conf.rcd

4. Generate ZNC config:

 rc.d makeconf znc

To make ZNC start on boot, add ZNC to DAEMONS in /etc/rc.conf.

Start and stop the ZNC daemon as usual by running:

 rc.d {start|stop|restart} znc

External links