3 # Startup script for the BNC
5 # chkconfig: 2345 81 45
6 # description: BNC is an IRC (Internet Relay Chat) proxying server
10 # Set some frequently user variables
12 LOCKFILE=/var/lock/subsys/$SERVICE
15 PIDFILE=/var/run/$SERVICE/$SERVICE.pid
17 # Source funtion library
18 . /etc/rc.d/init.d/functions
21 . /etc/sysconfig/network
23 # Check that networking is up
24 if is_yes "${NETWORKING}"; then
25 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
34 [ -f "/etc/sysconfig/$SERVICE" ] && . "/etc/sysconfig/$SERVICE"
37 # See how we were called.
40 if [ ! -f "$LOCKFILE" ]; then
42 if [ ! -f /var/log/bnc.log ]; then
43 touch /var/log/bnc.log
44 chown bnc:bnc /var/log/bnc.log
45 chmod 640 /var/log/bnc.log
49 start-stop-daemon --start --pidfile $PIDFILE --chuid bnc \
50 --chdir /etc/bnc --exec /usr/bin/bnc -- bnc.conf > /dev/null
52 # take or leave it, but rc=7 is successful exit code in bnc
53 [ $RETVAL = 7 ] && RETVAL=0
55 if [ $RETVAL -eq 0 ]; then
62 msg_already_running $MSG
66 if [ -f "$LOCKFILE" ]; then
68 if start-stop-daemon --stop --oknodo --pidfile $PIDFILE; then
69 rm -f $PIDFILE $LOCKFILE >/dev/null 2>&1
75 msg_not_running "$MSG"
88 msg_usage "$0 {start|stop|restart|force-reload|status}"