remove init files

git-svn: trunk@4973
remotes/push_mirror/0.95
aCaB 16 years ago
parent 0a0a739358
commit a0fbd33234
  1. 4
      ChangeLog
  2. 52
      contrib/init/FreeBSD5.2/clamav
  3. 52
      contrib/init/NetBSD2.0/clamav
  4. 9
      contrib/init/OpenBSD3.6/README
  5. 104
      contrib/init/RedHat/clamav-milter
  6. 89
      contrib/init/RedHat/clamd
  7. 28
      contrib/init/Solaris10/clamav-milter
  8. 18
      contrib/init/Solaris10/clamd
  9. 101
      contrib/init/SuSE/clamd

@ -1,3 +1,7 @@
Sun Mar 22 17:35:31 CET 2009 (acab)
-----------------------------------
* contrib/init: removed
Sun Mar 22 17:30:03 CET 2009 (tk)
---------------------------------
* contrib/DJGPP: add DJGPP patch from Blair <Blairdude*gmail.com> (bb#1317)

@ -1,52 +0,0 @@
#!/bin/sh
# Copyright (C) 2004 Nigel Horne <njh@bandsman.co.uk>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301, USA.
#
# Install into /usr/local/etc/rc.d as /usr/local/etc/rc.d/clamav.sh
# chmod 755 /usr/local/etc/rc.d/clamav.sh
#
# Add lines such as this to /etc/rc.conf:
# clamd_enable="YES"
# clamav_milter_enable="YES"
# clamav_milter_flags="--max-children=2 --dont-wait --timeout=0 -P local:/var/run/clamav/clamav.sock --pidfile=/var/run/clamav/clamav-milter.pid --quarantine-dir=/var/run/clamav/quarantine"
#
# Tested with FreeBSD 5.2 and 5.3
# PROVIDE: clamav
# REQUIRE: NETWORKING
# KEYWORD: FreeBSD
. /etc/rc.subr
# Don't allow files larger than 20M to be created, to limit DoS
# Needs to be large enough to extract the signature files
ulimit -f 20000
name="clamd"
rcvar="`set_rcvar`"
command="/usr/local/sbin/${name}"
load_rc_config $name
run_rc_command "$1"
name="clamav_milter"
rcvar="`set_rcvar`"
command="/usr/local/sbin/clamav-milter"
load_rc_config $name
run_rc_command "$1"

@ -1,52 +0,0 @@
#!/bin/sh
# Copyright (C) 2004 Nigel Horne <njh@bandsman.co.uk>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301, USA.
#
# Install into /etc/rc.d as /etc/rc.d/clamav
# chmod 755 /etc/rc.d/clamav
#
# Add lines such as this to /etc/rc.conf:
# clamd="YES"
# clamav_milter="YES"
# clamav_milter_flags="--max-children=2 --dont-wait --timeout=0 -P local:/var/run/clamav/clamav.sock --pidfile=/var/run/clamav/clamav-milter.pid --quarantine-dir=/var/run/clamav/quarantine"
#
# Tested with NetBSD 2.0
# PROVIDE: clamav
# REQUIRE: NETWORKING
# KEYWORD: NetBSD
. /etc/rc.subr
# Don't allow files larger than 20M to be created, to limit DoS
# Needs to be large enough to extract the signature files
ulimit -f 20000
name="clamd"
command="/usr/local/sbin/${name}"
load_rc_config $name
run_rc_command "$1"
name="clamav_milter"
command="/usr/local/sbin/clamav-milter"
load_rc_config $name
if [ $clamav_milter = YES ]; then
run_rc_command "$1"
fi

@ -1,9 +0,0 @@
Edit /etc/rc.local adding the following before the "echo '.'" line, you
should also call freshclam.
if [ -x /usr/local/sbin/clamd ]; then
echo -n ' clamd'
# Don't allow files larger than 20M to be created, to limit DoS
# Needs to be large enough to extract the signature files
(ulimit -f 20000 && /usr/local/sbin/clamd)
fi

@ -1,104 +0,0 @@
#!/bin/sh
#
# clamav-milter This script starts and stops the clamav-milter daemon
#
# chkconfig: 2345 79 40
#
# description: clamav-milter is a daemon which hooks into sendmail and routes \
# email messages for virus scanning with ClamAV
# processname: clamav-milter
# pidfile: /var/lock/subsys/clamav-milter
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
# Local clamav-milter config
CLAMAV_FLAGS=
test -f /etc/sysconfig/clamav-milter && . /etc/sysconfig/clamav-milter
# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0
[ -x /usr/local/sbin/clamav-milter ] || exit 0
PATH=$PATH:/usr/bin:/usr/local/sbin:/usr/local/bin
RETVAL=0
# Clamav-milter must have write access to the pid file, /var/run is not suitable
default_pidfile=
[ -d /var/run/clamav-milter ] && default_pidfile=/var/run/clamav-milter/clamav-milter.pid
[ -d /var/clamav ] && default_pidfile=/var/clamav/clamav-milter.pid
pidfile=${PIDFILE:-$default_pidfile}
lockfile=/var/lock/subsys/clamav-milter
start() {
echo -n "Starting clamav-milter: "
# Don't allow files larger than 25M to be created, to limit DoS
# Needs to be large enough to extract the signature files
ulimit -f 25600
if [ ! -z $pidfile ]; then
CLAMAV_PID=--pidfile=${pidfile}
PID=`pidofproc -p ${pidfile} clamav-milter`
else
CLAMAV_PID=
PID=`pidofproc clamav-milter`
fi
[ -n "$PID" ] && echo " already running!" && return 1
LANG= daemon clamav-milter $CLAMAV_PID ${CLAMAV_FLAGS}
RETVAL=$?
[ ! -z $pidfile -a -f $pidfile ] && sed -i -e 's/-//' $pidfile
echo
test $RETVAL -eq 0 && touch ${lockfile}
return $RETVAL
}
stop() {
echo -n "Shutting down clamav-milter: "
if [ ! -z $pidfile ]; then
killproc -p ${pidfile} clamav-milter
else
killproc clamav-milter
fi
RETVAL=$?
echo
test $RETVAL -eq 0 && rm -f ${lockfile} ${pidfile}
}
restart() {
stop
start
}
# See how we were called.
case "$1" in
start)
# Start daemon.
start
;;
stop)
# Stop daemon.
stop
;;
restart|reload)
restart
;;
condrestart)
test -f ${lockfile} && $0 restart || :
;;
status)
if [ ! -z $pidfile ]; then
status -p ${pidfile} clamav-milter
else
status clamav-milter
fi
;;
*)
echo "Usage: $0 {start|stop|reload|restart|condrestart|status}"
exit 1
esac
exit $?

@ -1,89 +0,0 @@
#! /bin/bash
#
# crond Start/Stop the clam antivirus daemon.
#
# chkconfig: 2345 70 41
# description: clamd is a standard Linux/UNIX program that scans for Viruses.
# processname: clamd
# config: /usr/local/etc/clamd.conf
# pidfile: /var/lock/subsys/clamd
# Source function library.
. /etc/init.d/functions
RETVAL=0
# See how we were called.
prog="clamd"
progdir="/usr/local/sbin"
# Source configuration
if [ -f /etc/sysconfig/$prog ] ; then
. /etc/sysconfig/$prog
fi
start() {
echo -n $"Starting $prog: "
# Don't allow files larger than 20M to be created, to limit DoS
# Needs to be large enough to extract the signature files
ulimit -f 20000
LANG= daemon $progdir/$prog
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/clamd
return $RETVAL
}
stop() {
echo -n $"Stopping $prog: "
# Would be better to send QUIT first, then killproc if that fails
killproc $prog
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/clamd
return $RETVAL
}
rhstatus() {
status clamd
}
restart() {
stop
start
}
reload() {
echo -n $"Reloading clam daemon configuration: "
killproc clamd -HUP
retval=$?
echo
return $RETVAL
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
restart
;;
reload)
reload
;;
status)
rhstatus
;;
condrestart)
[ -f /var/lock/subsys/clamd ] && restart || :
;;
*)
echo $"Usage: $0 {start|stop|status|reload|restart|condrestart}"
exit 1
esac
exit $?

@ -1,28 +0,0 @@
#!/bin/sh
CONF_FILE=/usr/local/etc/clamd.conf
RUNDIR=/var/run/clamav
CLAMAV_MILTER_FLAGS="-l --max-children=2 local:$RUNDIR/clmilter.sock"
if [ ! -f $CONF_FILE ]; then
exit 0
fi
if [ ! -d $RUNDIR ]; then
/usr/bin/mkdir -p -m 700 $RUNDIR
USER=`fgrep User ${CONF_FILE} | awk '{ print $2 }'`
if [ x$USER != x ]; then
chown $USER $RUNDIR
fi
fi
case "$1" in
start)
/usr/local/sbin/clamav-milter $CLAMAV_MILTER_FLAGS
;;
stop)
kill `ps -ef | awk '$NF ~ /clamav-milter/ { print $2 }'` > /dev/null 2>&1
;;
*)
echo "usage: $0 {start|stop}"
esac

@ -1,18 +0,0 @@
#!/bin/sh
CONF_FILE=/usr/local/etc/clamd.conf
if [ ! -f $CONF_FILE ]; then
exit 0
fi
case "$1" in
start)
/usr/local/sbin/clamd
;;
stop)
kill `ps -ef | awk '$NF ~ /clamd/ { print $2 }'` > /dev/null 2>&1
;;
*)
echo "usage: $0 {start|stop}"
esac

@ -1,101 +0,0 @@
#! /bin/sh
# v1.2 05-2004, martin fuxa, yeti@email.cz
#
### BEGIN INIT INFO
# Provides: clamd
# Required-Start:
# Required-Stop:
# Default-Start: 2 3 5
# Default-Stop: 0 1 2 6
# Description: Control clamav daemon.
### END INIT INFO
#
### HISTORY
# 2004-05-27 ADD - FreshClam code
# Variables
PID="/var/run/clamd.pid"
SBIN="/usr/local/sbin/clamd"
CONF="/etc/clamav.conf"
WHAT="Clam AntiVirus"
# START_FRESHCLAM value: 1=true, 0 false
START_FRESHCLAM=1
FRESHCLAM_SBIN="/usr/local/bin/freshclam"
FRESHCLAM_CONF="/etc/freshclam.conf"
FRESHCLAM_WHAT="FreshClam"
# Source SuSE config
. /etc/rc.status
test -x $SBIN || exit 5
test -e $CONF || exit 5
if [ $START_FRESHCLAM = 1 ]
then
test -x $FRESHCLAM_SBIN || exit 5
test -e $FRESHCLAM_CONF || exit 5
fi
# First reset status of this service
rc_reset
# Process request
case "$1" in
start)
if [ $START_FRESHCLAM = 1 ]
then
echo -n "Starting ${FRESHCLAM_WHAT} ${FRESHCLAM_CONF}"
startproc $FRESHCLAM_SBIN --daemon --config-file=${FRESHCLAM_CONF}
rc_status -v
fi
echo -n "Starting ${WHAT} ${CONF} "
## Start daemon with startproc(8). If this fails
## the echo return value is set appropriate.
startproc $SBIN $CONF
# Remember status and be verbose
rc_status -v
## start freshclam
;;
stop)
echo -n "Shutting down ${WHAT}"
## Stop daemon with killproc(8) and if this fails
## set echo the echo return value.
killproc -TERM $SBIN
# Remember status and be verbose
rc_status -v
if [ $START_FRESHCLAM = 1 ]
then
echo -n "Shutting down ${FRESHCLAM_WHAT}"
killproc -TERM $FRESHCLAM_SBIN
rc_status -v
fi
;;
restart)
## Stop the service and regardless of whether it was
## running or not, start it again.
$0 stop
$0 start
# Remember status and be quiet
rc_status
;;
status)
echo -n "Checking for ${WHAT} "
checkproc $SBIN
rc_status -v
if [ $START_FRESHCLAM = 1 ]
then
echo -n "Checking for ${FRESHCLAM_WHAT} "
checkproc $FRESHCLAM_SBIN
rc_status -v
fi
;;
*)
echo "Usage: $0 {start|stop|status|restart}"
exit 1
;;
esac
rc_exit
### END
Loading…
Cancel
Save