IRCNow

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
openbsd:irc:znc [2020/06/21 13:35]
jrmu
openbsd:irc:znc [2020/08/01 09:02] (current)
baytuch
Line 40: Line 40:
 </​code>​ </​code>​
  
-There should be a line with znc that looks like this (I check to make sure znc has the right login class):+There should be a line with znc that looks like this (I check to make sure znc has the right login class; the '​1001'​ is the uid, which you may find to be different from this example, but it should not be changed):
  
 <​code>​ <​code>​
Line 51: Line 51:
 $ doas cap_mkdb /​etc/​login.conf $ doas cap_mkdb /​etc/​login.conf
 </​code>​ </​code>​
 +
 +Now change znc shell to /bin/ksh , then continue with the steps below.
  
 <​code>​ <​code>​
Line 66: Line 68:
 </​code>​ </​code>​
  
-I then set the default shell to /​sbin/​nologin:​+ 
 +I then set the default shell to /​sbin/​nologin ​(note: the '​1001'​ is the uid, which you may find to be different from this example, but it should not be changed.):
  
 <​code>​ <​code>​
Line 149: Line 152:
 # export HOME=/​home/​znc # export HOME=/​home/​znc
 # /​usr/​sbin/​chroot -u znc -g znc /home/znc znc >>/​var/​log/​znc.log 2>&1 & # /​usr/​sbin/​chroot -u znc -g znc /home/znc znc >>/​var/​log/​znc.log 2>&1 &
 +</​code>​
 +
 +Creating a start script:
 +<​code>​
 +doas touch /​etc/​rc.d/​znc
 +doas chmod +x /​etc/​rc.d/​znc
 +</​code>​
 +
 +File contents:
 +<​code>​
 +#!/bin/ksh
 +#
 +# $OpenBSD: znc,v 1.2 2018/01/11 19:27:07 rpe Exp $
 +
 +daemon_pidfile="/​home/​znc/​home/​znc/​.znc/​znc.pid"​
 +daemon="​env HOME=/​home/​znc /​usr/​sbin/​chroot -u znc -g znc /home/znc znc"
 +
 +
 +service_stop() {
 +  if [ -f $daemon_pidfile ]; then
 +    pid=$(sed '​s/​[^0-9]*//​g'​ $daemon_pidfile)
 +    kill $pid
 +  fi
 +}
 +
 +case "​$1"​ in
 +  stop)
 +    service_stop
 +    ;;
 +esac
 +
 +
 +. /​etc/​rc.d/​rc.subr
 +
 +rc_reload=NO
 +
 +rc_cmd $1
 +</​code>​
 +
 +<​code>​
 +doas rcctl start znc
 +doas rcctl stop znc
 </​code>​ </​code>​
  
Line 195: Line 240:
 SSLDHParamFile = /​home/​znc/​.znc/​dhparam.pem SSLDHParamFile = /​home/​znc/​.znc/​dhparam.pem
 SSLKeyFile = /​home/​znc/​.znc/​my.example.com.key SSLKeyFile = /​home/​znc/​.znc/​my.example.com.key
 +PidFile = /​home/​znc/​.znc/​znc.pid
 ServerThrottle = 30 ServerThrottle = 30
 Version = 1.7.5 Version = 1.7.5