git-svn: trunk@4973
aCaB authored on 2009/03/23 01:36:244 | 8 |
deleted file mode 100755 |
... | ... |
@@ -1,52 +0,0 @@ |
1 |
-#!/bin/sh |
|
2 |
- |
|
3 |
-# Copyright (C) 2004 Nigel Horne <njh@bandsman.co.uk> |
|
4 |
-# |
|
5 |
-# This program is free software; you can redistribute it and/or modify |
|
6 |
-# it under the terms of the GNU General Public License as published by |
|
7 |
-# the Free Software Foundation; either version 2 of the License, or |
|
8 |
-# (at your option) any later version. |
|
9 |
-# |
|
10 |
-# This program is distributed in the hope that it will be useful, |
|
11 |
-# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
-# GNU General Public License for more details. |
|
14 |
-# |
|
15 |
-# You should have received a copy of the GNU General Public License |
|
16 |
-# along with this program; if not, write to the Free Software |
|
17 |
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
18 |
-# MA 02110-1301, USA. |
|
19 |
-# |
|
20 |
-# Install into /usr/local/etc/rc.d as /usr/local/etc/rc.d/clamav.sh |
|
21 |
-# chmod 755 /usr/local/etc/rc.d/clamav.sh |
|
22 |
-# |
|
23 |
-# Add lines such as this to /etc/rc.conf: |
|
24 |
-# clamd_enable="YES" |
|
25 |
-# clamav_milter_enable="YES" |
|
26 |
-# 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" |
|
27 |
-# |
|
28 |
-# Tested with FreeBSD 5.2 and 5.3 |
|
29 |
- |
|
30 |
-# PROVIDE: clamav |
|
31 |
-# REQUIRE: NETWORKING |
|
32 |
-# KEYWORD: FreeBSD |
|
33 |
- |
|
34 |
-. /etc/rc.subr |
|
35 |
- |
|
36 |
-# Don't allow files larger than 20M to be created, to limit DoS |
|
37 |
-# Needs to be large enough to extract the signature files |
|
38 |
-ulimit -f 20000 |
|
39 |
- |
|
40 |
-name="clamd" |
|
41 |
-rcvar="`set_rcvar`" |
|
42 |
-command="/usr/local/sbin/${name}" |
|
43 |
- |
|
44 |
-load_rc_config $name |
|
45 |
-run_rc_command "$1" |
|
46 |
- |
|
47 |
-name="clamav_milter" |
|
48 |
-rcvar="`set_rcvar`" |
|
49 |
-command="/usr/local/sbin/clamav-milter" |
|
50 |
- |
|
51 |
-load_rc_config $name |
|
52 |
-run_rc_command "$1" |
53 | 1 |
deleted file mode 100755 |
... | ... |
@@ -1,52 +0,0 @@ |
1 |
-#!/bin/sh |
|
2 |
- |
|
3 |
-# Copyright (C) 2004 Nigel Horne <njh@bandsman.co.uk> |
|
4 |
-# |
|
5 |
-# This program is free software; you can redistribute it and/or modify |
|
6 |
-# it under the terms of the GNU General Public License as published by |
|
7 |
-# the Free Software Foundation; either version 2 of the License, or |
|
8 |
-# (at your option) any later version. |
|
9 |
-# |
|
10 |
-# This program is distributed in the hope that it will be useful, |
|
11 |
-# but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
-# GNU General Public License for more details. |
|
14 |
-# |
|
15 |
-# You should have received a copy of the GNU General Public License |
|
16 |
-# along with this program; if not, write to the Free Software |
|
17 |
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
18 |
-# MA 02110-1301, USA. |
|
19 |
-# |
|
20 |
-# Install into /etc/rc.d as /etc/rc.d/clamav |
|
21 |
-# chmod 755 /etc/rc.d/clamav |
|
22 |
-# |
|
23 |
-# Add lines such as this to /etc/rc.conf: |
|
24 |
-# clamd="YES" |
|
25 |
-# clamav_milter="YES" |
|
26 |
-# 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" |
|
27 |
-# |
|
28 |
-# Tested with NetBSD 2.0 |
|
29 |
- |
|
30 |
-# PROVIDE: clamav |
|
31 |
-# REQUIRE: NETWORKING |
|
32 |
-# KEYWORD: NetBSD |
|
33 |
- |
|
34 |
-. /etc/rc.subr |
|
35 |
- |
|
36 |
-# Don't allow files larger than 20M to be created, to limit DoS |
|
37 |
-# Needs to be large enough to extract the signature files |
|
38 |
-ulimit -f 20000 |
|
39 |
- |
|
40 |
-name="clamd" |
|
41 |
-command="/usr/local/sbin/${name}" |
|
42 |
- |
|
43 |
-load_rc_config $name |
|
44 |
-run_rc_command "$1" |
|
45 |
- |
|
46 |
-name="clamav_milter" |
|
47 |
-command="/usr/local/sbin/clamav-milter" |
|
48 |
- |
|
49 |
-load_rc_config $name |
|
50 |
-if [ $clamav_milter = YES ]; then |
|
51 |
- run_rc_command "$1" |
|
52 |
-fi |
53 | 1 |
deleted file mode 100644 |
... | ... |
@@ -1,9 +0,0 @@ |
1 |
-Edit /etc/rc.local adding the following before the "echo '.'" line, you |
|
2 |
-should also call freshclam. |
|
3 |
- |
|
4 |
-if [ -x /usr/local/sbin/clamd ]; then |
|
5 |
- echo -n ' clamd' |
|
6 |
- # Don't allow files larger than 20M to be created, to limit DoS |
|
7 |
- # Needs to be large enough to extract the signature files |
|
8 |
- (ulimit -f 20000 && /usr/local/sbin/clamd) |
|
9 |
-fi |
10 | 1 |
deleted file mode 100755 |
... | ... |
@@ -1,104 +0,0 @@ |
1 |
-#!/bin/sh |
|
2 |
-# |
|
3 |
-# clamav-milter This script starts and stops the clamav-milter daemon |
|
4 |
-# |
|
5 |
-# chkconfig: 2345 79 40 |
|
6 |
-# |
|
7 |
-# description: clamav-milter is a daemon which hooks into sendmail and routes \ |
|
8 |
-# email messages for virus scanning with ClamAV |
|
9 |
-# processname: clamav-milter |
|
10 |
-# pidfile: /var/lock/subsys/clamav-milter |
|
11 |
- |
|
12 |
-# Source function library. |
|
13 |
-. /etc/rc.d/init.d/functions |
|
14 |
- |
|
15 |
-# Source networking configuration. |
|
16 |
-. /etc/sysconfig/network |
|
17 |
- |
|
18 |
-# Local clamav-milter config |
|
19 |
-CLAMAV_FLAGS= |
|
20 |
-test -f /etc/sysconfig/clamav-milter && . /etc/sysconfig/clamav-milter |
|
21 |
- |
|
22 |
-# Check that networking is up. |
|
23 |
-[ ${NETWORKING} = "no" ] && exit 0 |
|
24 |
- |
|
25 |
-[ -x /usr/local/sbin/clamav-milter ] || exit 0 |
|
26 |
-PATH=$PATH:/usr/bin:/usr/local/sbin:/usr/local/bin |
|
27 |
- |
|
28 |
-RETVAL=0 |
|
29 |
- |
|
30 |
-# Clamav-milter must have write access to the pid file, /var/run is not suitable |
|
31 |
-default_pidfile= |
|
32 |
-[ -d /var/run/clamav-milter ] && default_pidfile=/var/run/clamav-milter/clamav-milter.pid |
|
33 |
-[ -d /var/clamav ] && default_pidfile=/var/clamav/clamav-milter.pid |
|
34 |
-pidfile=${PIDFILE:-$default_pidfile} |
|
35 |
- |
|
36 |
-lockfile=/var/lock/subsys/clamav-milter |
|
37 |
- |
|
38 |
-start() { |
|
39 |
- echo -n "Starting clamav-milter: " |
|
40 |
- # Don't allow files larger than 25M to be created, to limit DoS |
|
41 |
- # Needs to be large enough to extract the signature files |
|
42 |
- ulimit -f 25600 |
|
43 |
- if [ ! -z $pidfile ]; then |
|
44 |
- CLAMAV_PID=--pidfile=${pidfile} |
|
45 |
- PID=`pidofproc -p ${pidfile} clamav-milter` |
|
46 |
- else |
|
47 |
- CLAMAV_PID= |
|
48 |
- PID=`pidofproc clamav-milter` |
|
49 |
- fi |
|
50 |
- [ -n "$PID" ] && echo " already running!" && return 1 |
|
51 |
- LANG= daemon clamav-milter $CLAMAV_PID ${CLAMAV_FLAGS} |
|
52 |
- RETVAL=$? |
|
53 |
- [ ! -z $pidfile -a -f $pidfile ] && sed -i -e 's/-//' $pidfile |
|
54 |
- echo |
|
55 |
- test $RETVAL -eq 0 && touch ${lockfile} |
|
56 |
- return $RETVAL |
|
57 |
-} |
|
58 |
- |
|
59 |
-stop() { |
|
60 |
- echo -n "Shutting down clamav-milter: " |
|
61 |
- if [ ! -z $pidfile ]; then |
|
62 |
- killproc -p ${pidfile} clamav-milter |
|
63 |
- else |
|
64 |
- killproc clamav-milter |
|
65 |
- fi |
|
66 |
- RETVAL=$? |
|
67 |
- echo |
|
68 |
- test $RETVAL -eq 0 && rm -f ${lockfile} ${pidfile} |
|
69 |
-} |
|
70 |
- |
|
71 |
-restart() { |
|
72 |
- stop |
|
73 |
- start |
|
74 |
-} |
|
75 |
- |
|
76 |
-# See how we were called. |
|
77 |
-case "$1" in |
|
78 |
- start) |
|
79 |
- # Start daemon. |
|
80 |
- start |
|
81 |
- ;; |
|
82 |
- stop) |
|
83 |
- # Stop daemon. |
|
84 |
- stop |
|
85 |
- ;; |
|
86 |
- restart|reload) |
|
87 |
- restart |
|
88 |
- ;; |
|
89 |
- condrestart) |
|
90 |
- test -f ${lockfile} && $0 restart || : |
|
91 |
- ;; |
|
92 |
- status) |
|
93 |
- if [ ! -z $pidfile ]; then |
|
94 |
- status -p ${pidfile} clamav-milter |
|
95 |
- else |
|
96 |
- status clamav-milter |
|
97 |
- fi |
|
98 |
- ;; |
|
99 |
- *) |
|
100 |
- echo "Usage: $0 {start|stop|reload|restart|condrestart|status}" |
|
101 |
- exit 1 |
|
102 |
-esac |
|
103 |
- |
|
104 |
-exit $? |
105 | 1 |
deleted file mode 100755 |
... | ... |
@@ -1,89 +0,0 @@ |
1 |
-#! /bin/bash |
|
2 |
-# |
|
3 |
-# crond Start/Stop the clam antivirus daemon. |
|
4 |
-# |
|
5 |
-# chkconfig: 2345 70 41 |
|
6 |
-# description: clamd is a standard Linux/UNIX program that scans for Viruses. |
|
7 |
-# processname: clamd |
|
8 |
-# config: /usr/local/etc/clamd.conf |
|
9 |
-# pidfile: /var/lock/subsys/clamd |
|
10 |
- |
|
11 |
-# Source function library. |
|
12 |
-. /etc/init.d/functions |
|
13 |
- |
|
14 |
-RETVAL=0 |
|
15 |
- |
|
16 |
-# See how we were called. |
|
17 |
- |
|
18 |
-prog="clamd" |
|
19 |
-progdir="/usr/local/sbin" |
|
20 |
- |
|
21 |
-# Source configuration |
|
22 |
-if [ -f /etc/sysconfig/$prog ] ; then |
|
23 |
- . /etc/sysconfig/$prog |
|
24 |
-fi |
|
25 |
- |
|
26 |
-start() { |
|
27 |
- echo -n $"Starting $prog: " |
|
28 |
- # Don't allow files larger than 20M to be created, to limit DoS |
|
29 |
- # Needs to be large enough to extract the signature files |
|
30 |
- ulimit -f 20000 |
|
31 |
- LANG= daemon $progdir/$prog |
|
32 |
- RETVAL=$? |
|
33 |
- echo |
|
34 |
- [ $RETVAL -eq 0 ] && touch /var/lock/subsys/clamd |
|
35 |
- return $RETVAL |
|
36 |
-} |
|
37 |
- |
|
38 |
-stop() { |
|
39 |
- echo -n $"Stopping $prog: " |
|
40 |
- # Would be better to send QUIT first, then killproc if that fails |
|
41 |
- killproc $prog |
|
42 |
- RETVAL=$? |
|
43 |
- echo |
|
44 |
- [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/clamd |
|
45 |
- return $RETVAL |
|
46 |
-} |
|
47 |
- |
|
48 |
-rhstatus() { |
|
49 |
- status clamd |
|
50 |
-} |
|
51 |
- |
|
52 |
-restart() { |
|
53 |
- stop |
|
54 |
- start |
|
55 |
-} |
|
56 |
- |
|
57 |
-reload() { |
|
58 |
- echo -n $"Reloading clam daemon configuration: " |
|
59 |
- killproc clamd -HUP |
|
60 |
- retval=$? |
|
61 |
- echo |
|
62 |
- return $RETVAL |
|
63 |
-} |
|
64 |
- |
|
65 |
-case "$1" in |
|
66 |
- start) |
|
67 |
- start |
|
68 |
- ;; |
|
69 |
- stop) |
|
70 |
- stop |
|
71 |
- ;; |
|
72 |
- restart) |
|
73 |
- restart |
|
74 |
- ;; |
|
75 |
- reload) |
|
76 |
- reload |
|
77 |
- ;; |
|
78 |
- status) |
|
79 |
- rhstatus |
|
80 |
- ;; |
|
81 |
- condrestart) |
|
82 |
- [ -f /var/lock/subsys/clamd ] && restart || : |
|
83 |
- ;; |
|
84 |
- *) |
|
85 |
- echo $"Usage: $0 {start|stop|status|reload|restart|condrestart}" |
|
86 |
- exit 1 |
|
87 |
-esac |
|
88 |
- |
|
89 |
-exit $? |
90 | 1 |
deleted file mode 100644 |
... | ... |
@@ -1,28 +0,0 @@ |
1 |
-#!/bin/sh |
|
2 |
- |
|
3 |
-CONF_FILE=/usr/local/etc/clamd.conf |
|
4 |
-RUNDIR=/var/run/clamav |
|
5 |
-CLAMAV_MILTER_FLAGS="-l --max-children=2 local:$RUNDIR/clmilter.sock" |
|
6 |
- |
|
7 |
-if [ ! -f $CONF_FILE ]; then |
|
8 |
- exit 0 |
|
9 |
-fi |
|
10 |
- |
|
11 |
-if [ ! -d $RUNDIR ]; then |
|
12 |
- /usr/bin/mkdir -p -m 700 $RUNDIR |
|
13 |
- USER=`fgrep User ${CONF_FILE} | awk '{ print $2 }'` |
|
14 |
- if [ x$USER != x ]; then |
|
15 |
- chown $USER $RUNDIR |
|
16 |
- fi |
|
17 |
-fi |
|
18 |
- |
|
19 |
-case "$1" in |
|
20 |
- start) |
|
21 |
- /usr/local/sbin/clamav-milter $CLAMAV_MILTER_FLAGS |
|
22 |
- ;; |
|
23 |
- stop) |
|
24 |
- kill `ps -ef | awk '$NF ~ /clamav-milter/ { print $2 }'` > /dev/null 2>&1 |
|
25 |
- ;; |
|
26 |
- *) |
|
27 |
- echo "usage: $0 {start|stop}" |
|
28 |
-esac |
29 | 1 |
deleted file mode 100755 |
... | ... |
@@ -1,18 +0,0 @@ |
1 |
-#!/bin/sh |
|
2 |
- |
|
3 |
-CONF_FILE=/usr/local/etc/clamd.conf |
|
4 |
- |
|
5 |
-if [ ! -f $CONF_FILE ]; then |
|
6 |
- exit 0 |
|
7 |
-fi |
|
8 |
- |
|
9 |
-case "$1" in |
|
10 |
- start) |
|
11 |
- /usr/local/sbin/clamd |
|
12 |
- ;; |
|
13 |
- stop) |
|
14 |
- kill `ps -ef | awk '$NF ~ /clamd/ { print $2 }'` > /dev/null 2>&1 |
|
15 |
- ;; |
|
16 |
- *) |
|
17 |
- echo "usage: $0 {start|stop}" |
|
18 |
-esac |
19 | 1 |
deleted file mode 100755 |
... | ... |
@@ -1,101 +0,0 @@ |
1 |
-#! /bin/sh |
|
2 |
-# v1.2 05-2004, martin fuxa, yeti@email.cz |
|
3 |
-# |
|
4 |
-### BEGIN INIT INFO |
|
5 |
-# Provides: clamd |
|
6 |
-# Required-Start: |
|
7 |
-# Required-Stop: |
|
8 |
-# Default-Start: 2 3 5 |
|
9 |
-# Default-Stop: 0 1 2 6 |
|
10 |
-# Description: Control clamav daemon. |
|
11 |
-### END INIT INFO |
|
12 |
-# |
|
13 |
-### HISTORY |
|
14 |
-# 2004-05-27 ADD - FreshClam code |
|
15 |
- |
|
16 |
-# Variables |
|
17 |
-PID="/var/run/clamd.pid" |
|
18 |
-SBIN="/usr/local/sbin/clamd" |
|
19 |
-CONF="/etc/clamav.conf" |
|
20 |
-WHAT="Clam AntiVirus" |
|
21 |
- |
|
22 |
-# START_FRESHCLAM value: 1=true, 0 false |
|
23 |
-START_FRESHCLAM=1 |
|
24 |
-FRESHCLAM_SBIN="/usr/local/bin/freshclam" |
|
25 |
-FRESHCLAM_CONF="/etc/freshclam.conf" |
|
26 |
-FRESHCLAM_WHAT="FreshClam" |
|
27 |
- |
|
28 |
-# Source SuSE config |
|
29 |
-. /etc/rc.status |
|
30 |
- |
|
31 |
-test -x $SBIN || exit 5 |
|
32 |
-test -e $CONF || exit 5 |
|
33 |
- |
|
34 |
-if [ $START_FRESHCLAM = 1 ] |
|
35 |
-then |
|
36 |
- test -x $FRESHCLAM_SBIN || exit 5 |
|
37 |
- test -e $FRESHCLAM_CONF || exit 5 |
|
38 |
-fi |
|
39 |
- |
|
40 |
-# First reset status of this service |
|
41 |
-rc_reset |
|
42 |
- |
|
43 |
-# Process request |
|
44 |
-case "$1" in |
|
45 |
- start) |
|
46 |
- if [ $START_FRESHCLAM = 1 ] |
|
47 |
- then |
|
48 |
- echo -n "Starting ${FRESHCLAM_WHAT} ${FRESHCLAM_CONF}" |
|
49 |
- startproc $FRESHCLAM_SBIN --daemon --config-file=${FRESHCLAM_CONF} |
|
50 |
- rc_status -v |
|
51 |
- fi |
|
52 |
- echo -n "Starting ${WHAT} ${CONF} " |
|
53 |
- ## Start daemon with startproc(8). If this fails |
|
54 |
- ## the echo return value is set appropriate. |
|
55 |
- startproc $SBIN $CONF |
|
56 |
- # Remember status and be verbose |
|
57 |
- rc_status -v |
|
58 |
- ## start freshclam |
|
59 |
- |
|
60 |
- ;; |
|
61 |
- stop) |
|
62 |
- echo -n "Shutting down ${WHAT}" |
|
63 |
- ## Stop daemon with killproc(8) and if this fails |
|
64 |
- ## set echo the echo return value. |
|
65 |
- killproc -TERM $SBIN |
|
66 |
- # Remember status and be verbose |
|
67 |
- rc_status -v |
|
68 |
- if [ $START_FRESHCLAM = 1 ] |
|
69 |
- then |
|
70 |
- echo -n "Shutting down ${FRESHCLAM_WHAT}" |
|
71 |
- killproc -TERM $FRESHCLAM_SBIN |
|
72 |
- rc_status -v |
|
73 |
- fi |
|
74 |
- ;; |
|
75 |
- restart) |
|
76 |
- ## Stop the service and regardless of whether it was |
|
77 |
- ## running or not, start it again. |
|
78 |
- $0 stop |
|
79 |
- $0 start |
|
80 |
- # Remember status and be quiet |
|
81 |
- rc_status |
|
82 |
- ;; |
|
83 |
- status) |
|
84 |
- echo -n "Checking for ${WHAT} " |
|
85 |
- checkproc $SBIN |
|
86 |
- rc_status -v |
|
87 |
- if [ $START_FRESHCLAM = 1 ] |
|
88 |
- then |
|
89 |
- echo -n "Checking for ${FRESHCLAM_WHAT} " |
|
90 |
- checkproc $FRESHCLAM_SBIN |
|
91 |
- rc_status -v |
|
92 |
- fi |
|
93 |
- ;; |
|
94 |
- |
|
95 |
- *) |
|
96 |
- echo "Usage: $0 {start|stop|status|restart}" |
|
97 |
- exit 1 |
|
98 |
- ;; |
|
99 |
-esac |
|
100 |
-rc_exit |
|
101 |
-### END |