From 12c022f9b3b9a5244f851f1930286a5f8118cfd9 Mon Sep 17 00:00:00 2001 From: hawk Date: Mon, 2 Aug 2004 18:07:26 +0000 Subject: [PATCH] - file for bIRCd IRC server Changed files: bircd.init -> 1.1 bircd.logrotate -> 1.1 bircd.sysconfig -> 1.1 --- bircd.init | 80 +++++++++++++++++++++++++++++++++++++++++++++++++ bircd.logrotate | 29 ++++++++++++++++++ bircd.sysconfig | 2 ++ 3 files changed, 111 insertions(+) create mode 100644 bircd.init create mode 100644 bircd.logrotate create mode 100644 bircd.sysconfig diff --git a/bircd.init b/bircd.init new file mode 100644 index 0000000..1b85591 --- /dev/null +++ b/bircd.init @@ -0,0 +1,80 @@ +#!/bin/sh +# +# ircd This shell script takes care of starting and stopping ircd. +# +# chkconfig: 234 75 30 +# description: Internet Relay Chat Server. +# + +# Source function library. +. /etc/rc.d/init.d/functions + +# Source networking configuration. +. /etc/sysconfig/network + +# Get service config +[ -f /etc/sysconfig/ircd ] && . /etc/sysconfig/ircd + +# Check that networking is up. +if is_yes "${NETWORKING}"; then + if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then + msg_network_down bIRCd + exit 1 + fi +else + exit 0 +fi + +IRCD="/usr/sbin/ircd" + +RETVAL=0 +# See how we were called. +case "$1" in + start) + # Check if the service is already running? + if [ ! -f /var/lock/subsys/ircd ]; then + # Start daemons. + msg_starting "bIRCd Server" + daemon ${IRCD} + touch /var/lock/subsys/ircd + else + msg_already_running bIRCd + fi + ;; + stop) + # Check if the service is already running? + if [ -f /var/lock/subsys/ircd ]; then + # Stop daemons. + msg_stopping "bIRCd Server" + killproc ${IRCD#\-} + rm -f /var/lib/ircd/ircd.pid + rm -f /var/lock/subsys/ircd + else + msg_not_running bIRCd + fi + ;; + reload|force-reload) + if [ -f /var/lock/subsys/ircd ]; then + msg_reloading "bIRCd Server" + killproc ${IRCD#\-} -HUP + RETVAL=$? + else + msg_not_running bIRCd >&2 + exit 7 + fi + ;; + restart) + $0 stop + $0 start + exit $? + ;; + status) + status ${IRCD#\-} + exit $? + ;; + *) + msg_usage "$0 {start|stop|restart|reload|force-reload|status}" + exit 3 +esac + +exit $RETVAL diff --git a/bircd.logrotate b/bircd.logrotate new file mode 100644 index 0000000..c485297 --- /dev/null +++ b/bircd.logrotate @@ -0,0 +1,29 @@ +/var/log/ircd/users.log { + olddir /var/log/archiv/ircd + notifempty + create 640 ircd ircd + + postrotate + /etc/rc.d/init.d/ircd reload >/dev/null 2>&1 + endscript +} + +/var/log/ircd/opers.log { + olddir /var/log/archiv/ircd + notifempty + create 640 ircd ircd + + postrotate + /etc/rc.d/init.d/ircd reload >/dev/null 2>&1 + endscript +} + +/var/log/ircd/rejects.log { + olddir /var/log/archiv/ircd + notifempty + create 640 ircd ircd + + postrotate + /etc/rc.d/init.d/ircd reload >/dev/null 2>&1 + endscript +} diff --git a/bircd.sysconfig b/bircd.sysconfig new file mode 100644 index 0000000..434190e --- /dev/null +++ b/bircd.sysconfig @@ -0,0 +1,2 @@ +# Nice level for at +SERVICE_RUN_NICE_LEVEL="+0" -- 2.44.0