Add files from bug 756854
This commit is contained in:
parent
813ca6cc8c
commit
14d21bc46d
116
README.clamd-wrapper
Normal file
116
README.clamd-wrapper
Normal file
@ -0,0 +1,116 @@
|
||||
To create individual clamd-instance take the following files and
|
||||
modify/copy them in the suggested way:
|
||||
|
||||
clamd.conf:
|
||||
* set LogFile, PidFile, LocalSocket and User to suitable values
|
||||
* place this file into /etc/clamd.d with an unique service-name;
|
||||
e.g. as /etc/clamd.d/<SERVICE>.conf
|
||||
|
||||
To make logfile rotation work properly, the LogFile should be
|
||||
writable for the assigned User. Recommended way to reach this, is
|
||||
to:
|
||||
* make it owned by the User's *group*
|
||||
* assign at least 0620 (u+rw,g+w) permissions
|
||||
|
||||
A suitable command might be
|
||||
| # touch <logfile>
|
||||
| # chgrp <user> <logfile>
|
||||
| # chmod 0620 <logfile>
|
||||
|
||||
NEVER use 'clamav' as the user since he can modify the database.
|
||||
This is the user who is running the application; e.g. for mimedefang
|
||||
(http://www.roaringpenguin.com/mimedefang), the user might be
|
||||
'defang'.Theoretically, distinct users could be used, but it must be
|
||||
made sure that the application-user can write into the socket-file,
|
||||
and that the clamd-user can access the files asked by the
|
||||
application to be checked.
|
||||
|
||||
|
||||
clamd.logrotate:
|
||||
* set the correct value for the logfile
|
||||
* place it into /etc/logrotate.d
|
||||
|
||||
clamd.sysconfig:
|
||||
* set the name of the config-file and the local socket
|
||||
* copy it to /etc/sysconfig/clamd.<SERVICE>
|
||||
|
||||
clamd.init:
|
||||
* set the service-name
|
||||
* place it into /etc/init.d/ with an unique name and activate it
|
||||
(e.g. with /sbin/chkconfig clamd.<SERVICE> on)
|
||||
|
||||
Additionally, a symlink must be set to clamd in a way like
|
||||
| # ln -s clamd /usr/sbin/clamd.<SERVICE>
|
||||
and the directory for the socket file must be created (see 'LocalSocket'
|
||||
in clamd.conf)
|
||||
| # mkdir -p /var/run/clamd.<SERVICE>
|
||||
|
||||
|
||||
This directory must be writable by the 'User' chosen in the config-file.
|
||||
|
||||
|
||||
|
||||
[Disclaimer:
|
||||
this file and the script/configfiles are not part of the official
|
||||
clamav package.
|
||||
|
||||
Please send complaints and comments to
|
||||
mailto:enrico.scholz@informatik.tu-chemnitz.de!]
|
||||
To create individual clamd-instance take the following files and
|
||||
modify/copy them in the suggested way:
|
||||
|
||||
clamd.conf:
|
||||
* set LogFile, PidFile, LocalSocket and User to suitable values
|
||||
* place this file into /etc/clamd.d with an unique service-name;
|
||||
e.g. as /etc/clamd.d/<SERVICE>.conf
|
||||
|
||||
To make logfile rotation work properly, the LogFile should be
|
||||
writable for the assigned User. Recommended way to reach this, is
|
||||
to:
|
||||
* make it owned by the User's *group*
|
||||
* assign at least 0620 (u+rw,g+w) permissions
|
||||
|
||||
A suitable command might be
|
||||
| # touch <logfile>
|
||||
| # chgrp <user> <logfile>
|
||||
| # chmod 0620 <logfile>
|
||||
|
||||
NEVER use 'clamav' as the user since he can modify the database.
|
||||
This is the user who is running the application; e.g. for mimedefang
|
||||
(http://www.roaringpenguin.com/mimedefang), the user might be
|
||||
'defang'.Theoretically, distinct users could be used, but it must be
|
||||
made sure that the application-user can write into the socket-file,
|
||||
and that the clamd-user can access the files asked by the
|
||||
application to be checked.
|
||||
|
||||
|
||||
clamd.logrotate:
|
||||
* set the correct value for the logfile
|
||||
* place it into /etc/logrotate.d
|
||||
|
||||
clamd.sysconfig:
|
||||
* set the name of the config-file and the local socket
|
||||
* copy it to /etc/sysconfig/clamd.<SERVICE>
|
||||
|
||||
clamd.init:
|
||||
* set the service-name
|
||||
* place it into /etc/init.d/ with an unique name and activate it
|
||||
(e.g. with /sbin/chkconfig clamd.<SERVICE> on)
|
||||
|
||||
Additionally, a symlink must be set to clamd in a way like
|
||||
| # ln -s clamd /usr/sbin/clamd.<SERVICE>
|
||||
and the directory for the socket file must be created (see 'LocalSocket'
|
||||
in clamd.conf)
|
||||
| # mkdir -p /var/run/clamd.<SERVICE>
|
||||
|
||||
|
||||
This directory must be writable by the 'User' chosen in the config-file.
|
||||
|
||||
|
||||
|
||||
[Disclaimer:
|
||||
this file and the script/configfiles are not part of the official
|
||||
clamav package.
|
||||
|
||||
Please send complaints and comments to
|
||||
mailto:enrico.scholz@informatik.tu-chemnitz.de!]
|
8
clamav-milter.sysconfig
Normal file
8
clamav-milter.sysconfig
Normal file
@ -0,0 +1,8 @@
|
||||
### Simple config file for clamav-milter, you should
|
||||
### read the documentation and tweak it as you wish.
|
||||
|
||||
CLAMAV_FLAGS=""
|
||||
### Simple config file for clamav-milter, you should
|
||||
### read the documentation and tweak it as you wish.
|
||||
|
||||
CLAMAV_FLAGS=""
|
91
clamav.spec
91
clamav.spec
@ -5,7 +5,7 @@
|
||||
Summary: Anti-virus software
|
||||
Name: clamav
|
||||
Version: 0.97.3
|
||||
Release: 1%{?dist}
|
||||
Release: 2%{?dist}
|
||||
License: GPLv2
|
||||
Group: Applications/System
|
||||
URL: http://www.clamav.net/
|
||||
@ -15,7 +15,14 @@ URL: http://www.clamav.net/
|
||||
Source0: clamav-0.97.3-norar.tar.xz
|
||||
Source1: clamav.init
|
||||
Source2: clamav-milter.init
|
||||
Source3: clamd-wrapper.tar.bz2
|
||||
Source3: clamd-wrapper
|
||||
Source4: clamd.init
|
||||
Source5: README.clamd-wrapper
|
||||
Source6: clamd.sysconfig
|
||||
Source7: freshclam.logrotate
|
||||
Source8: freshclam.cron
|
||||
Source9: clamd.logrotate
|
||||
Source10: clamav-milter.sysconfig
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
|
||||
BuildRequires: bzip2-devel, zlib-devel, gmp-devel, curl-devel, xz
|
||||
@ -171,53 +178,6 @@ xz -dc %{SOURCE0} | (cd .. ; tar xvvf -)
|
||||
s|^#(ClamdSocket) .+$|$1 unix:%{_localstatedir}/run/clamav/clamd.sock|;
|
||||
' etc/clamav-milter.conf
|
||||
|
||||
|
||||
cat <<EOF >clamd.logrotate
|
||||
%{_localstatedir}/log/clamav/clamd.log {
|
||||
missingok
|
||||
notifempty
|
||||
create 644 clam clam
|
||||
postrotate
|
||||
killall -HUP clamd 2>/dev/null || :
|
||||
endscript
|
||||
}
|
||||
EOF
|
||||
|
||||
cat <<EOF >freshclam.logrotate
|
||||
%{_localstatedir}/log/clamav/freshclam.log {
|
||||
missingok
|
||||
notifempty
|
||||
create 644 clam clam
|
||||
}
|
||||
EOF
|
||||
|
||||
cat <<'EOF' >freshclam.cron
|
||||
#!/bin/sh
|
||||
|
||||
### A simple update script for the clamav virus database.
|
||||
### This could as well be replaced by a SysV script.
|
||||
|
||||
### fix log file if needed
|
||||
LOG_FILE="%{_localstatedir}/log/clamav/freshclam.log"
|
||||
if [ ! -f "$LOG_FILE" ]; then
|
||||
touch "$LOG_FILE"
|
||||
chmod 644 "$LOG_FILE"
|
||||
chown clam.clam "$LOG_FILE"
|
||||
fi
|
||||
|
||||
%{_bindir}/freshclam \
|
||||
--quiet \
|
||||
--datadir="%{_localstatedir}/lib/clamav" \
|
||||
--log="$LOG_FILE"
|
||||
EOF
|
||||
|
||||
%{__cat} <<EOF >clamav-milter.sysconfig
|
||||
### Simple config file for clamav-milter, you should
|
||||
### read the documentation and tweak it as you wish.
|
||||
|
||||
CLAMAV_FLAGS=""
|
||||
EOF
|
||||
|
||||
%build
|
||||
%configure \
|
||||
--program-prefix="%{?_program_prefix}" \
|
||||
@ -240,19 +200,30 @@ make %{?_smp_mflags}
|
||||
rm -rf %{buildroot}
|
||||
make install DESTDIR="%{buildroot}"
|
||||
|
||||
install -Dp -m0755 %{SOURCE1} %{buildroot}%{_initrddir}/clamd
|
||||
install -Dp -m0755 freshclam.cron %{buildroot}%{_sysconfdir}/cron.daily/freshclam
|
||||
install -Dp -m0644 freshclam.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/freshclam
|
||||
install -Dp -m0644 clamd.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/clamav
|
||||
install -Dp -m0755 %{SOURCE1} %{buildroot}%{_initrddir}/clamav
|
||||
install -Dp -m0755 %{SOURCE8} %{buildroot}%{_sysconfdir}/cron.daily/freshclam
|
||||
install -Dp -m0644 %{SOURCE7} %{buildroot}%{_sysconfdir}/logrotate.d/freshclam
|
||||
install -Dp -m0644 %{SOURCE9} %{buildroot}%{_sysconfdir}/logrotate.d/clamav
|
||||
|
||||
# now rewrite scripts and config files in-place
|
||||
sed -i \
|
||||
-e 's!%%{_sbindir}!%{_sbindir}!g' \
|
||||
-e 's!%%{_bindir}!%{_bindir}!g' \
|
||||
-e 's!%%{_localstatedir}!%{_localstatedir}!g' \
|
||||
%{buildroot}%{_sysconfdir}/logrotate.d/* \
|
||||
%{buildroot}%{_sysconfdir}/cron.daily/freshclam
|
||||
|
||||
%if %{!?_without_milter:1}0
|
||||
install -Dp -m0755 %{SOURCE2} %{buildroot}%{_initrddir}/clamav-milter
|
||||
install -Dp -m0644 clamav-milter.sysconfig %{buildroot}%{_sysconfdir}/sysconfig/clamav-milter
|
||||
install -Dp -m0644 %{SOURCE10} %{buildroot}%{_sysconfdir}/sysconfig/clamav-milter
|
||||
%else
|
||||
rm %{buildroot}%{_mandir}/man8/clamav-milter.8*
|
||||
%endif
|
||||
|
||||
# Install clamav-wrapper:
|
||||
tar xjf %{SOURCE3} -C %{buildroot}/%{_prefix}/share
|
||||
install -d -m0755 %{buildroot}/%{_prefix}/share/clamav
|
||||
install -m0755 -t %{buildroot}/%{_prefix}/share/clamav %{SOURCE3} %{SOURCE4}
|
||||
install -m0444 -t %{buildroot}/%{_prefix}/share/clamav %{SOURCE5} %{SOURCE6}
|
||||
|
||||
install -d -m0755 %{buildroot}%{_localstatedir}/log/clamav/
|
||||
touch %{buildroot}%{_localstatedir}/log/clamav/freshclam.log
|
||||
@ -345,8 +316,6 @@ rm -rf %{buildroot}
|
||||
%doc %{_mandir}/man1/clamscan.1*
|
||||
%doc %{_mandir}/man1/freshclam.1*
|
||||
%doc %{_mandir}/man5/freshclam.conf.5*
|
||||
%doc %{_prefix}/share/clamav/README.clamd-wrapper
|
||||
%{_prefix}/share/clamav/clamd-wrapper
|
||||
%config(noreplace) %{_sysconfdir}/freshclam.conf
|
||||
%{_bindir}/clamscan
|
||||
%{_bindir}/freshclam
|
||||
@ -366,10 +335,12 @@ rm -rf %{buildroot}
|
||||
%config(noreplace) %{_sysconfdir}/clamd.conf
|
||||
%config(noreplace) %{_sysconfdir}/logrotate.d/clamav
|
||||
%{_sysconfdir}/clamd.d
|
||||
%config %{_initrddir}/clamd
|
||||
%config %{_initrddir}/clamav
|
||||
%{_sbindir}/clamd
|
||||
%{_bindir}/clamconf
|
||||
%{_bindir}/clamdscan
|
||||
%doc %{_prefix}/share/clamav/README.clamd-wrapper
|
||||
%{_prefix}/share/clamav/clamd*
|
||||
|
||||
%defattr(0644, clam, clam, 0755)
|
||||
%{_localstatedir}/run/clamav/
|
||||
@ -409,6 +380,10 @@ rm -rf %{buildroot}
|
||||
%exclude %{_libdir}/libclamav.la
|
||||
|
||||
%changelog
|
||||
* Fri Nov 25 2011 Philip Prindeville <philipp@fedoraproject.org> - 0.97.3-2
|
||||
- Add missing clamd-wrapper supporting files
|
||||
- Remove from init script the unused CLAMD_SOCKET variable
|
||||
|
||||
* Tue Oct 18 2011 Nick Bebout <nb@fedoraproject.org> - 0.97.3-1
|
||||
- Update to 0.97.3
|
||||
- Fix CVE-2011-3627 clamav: Recursion level crash fixed in v0.97.3
|
||||
|
1091
clamav.spec.orig
Normal file
1091
clamav.spec.orig
Normal file
File diff suppressed because it is too large
Load Diff
152
clamav.spec.rej
Normal file
152
clamav.spec.rej
Normal file
@ -0,0 +1,152 @@
|
||||
--- clamav.spec
|
||||
+++ clamav.spec
|
||||
@@ -5,7 +5,7 @@
|
||||
Summary: Anti-virus software
|
||||
Name: clamav
|
||||
Version: 0.97.3
|
||||
-Release: 1%{?dist}
|
||||
+Release: 2%{?dist}
|
||||
License: GPLv2
|
||||
Group: Applications/System
|
||||
URL: http://www.clamav.net/
|
||||
@@ -15,7 +15,14 @@
|
||||
Source0: clamav-0.97.3-norar.tar.xz
|
||||
Source1: clamav.init
|
||||
Source2: clamav-milter.init
|
||||
-Source3: clamd-wrapper.tar.bz2
|
||||
+Source3: clamd-wrapper
|
||||
+Source4: clamd.init
|
||||
+Source5: README.clamd-wrapper
|
||||
+Source6: clamd.sysconfig
|
||||
+Source7: freshclam.logrotate
|
||||
+Source8: freshclam.cron
|
||||
+Source9: clamd.logrotate
|
||||
+Source10: clamav-milter.sysconfig
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
|
||||
BuildRequires: bzip2-devel, zlib-devel, gmp-devel, curl-devel, xz
|
||||
@@ -171,53 +178,6 @@
|
||||
s|^#(ClamdSocket) .+$|$1 unix:%{_localstatedir}/run/clamav/clamd.sock|;
|
||||
' etc/clamav-milter.conf
|
||||
|
||||
-
|
||||
-cat <<EOF >clamd.logrotate
|
||||
-%{_localstatedir}/log/clamav/clamd.log {
|
||||
- missingok
|
||||
- notifempty
|
||||
- create 644 clam clam
|
||||
- postrotate
|
||||
- killall -HUP clamd 2>/dev/null || :
|
||||
- endscript
|
||||
-}
|
||||
-EOF
|
||||
-
|
||||
-cat <<EOF >freshclam.logrotate
|
||||
-%{_localstatedir}/log/clamav/freshclam.log {
|
||||
- missingok
|
||||
- notifempty
|
||||
- create 644 clam clam
|
||||
-}
|
||||
-EOF
|
||||
-
|
||||
-cat <<'EOF' >freshclam.cron
|
||||
-#!/bin/sh
|
||||
-
|
||||
-### A simple update script for the clamav virus database.
|
||||
-### This could as well be replaced by a SysV script.
|
||||
-
|
||||
-### fix log file if needed
|
||||
-LOG_FILE="%{_localstatedir}/log/clamav/freshclam.log"
|
||||
-if [ ! -f "$LOG_FILE" ]; then
|
||||
- touch "$LOG_FILE"
|
||||
- chmod 644 "$LOG_FILE"
|
||||
- chown clam.clam "$LOG_FILE"
|
||||
-fi
|
||||
-
|
||||
-%{_bindir}/freshclam \
|
||||
- --quiet \
|
||||
- --datadir="%{_localstatedir}/lib/clamav" \
|
||||
- --log="$LOG_FILE"
|
||||
-EOF
|
||||
-
|
||||
-%{__cat} <<EOF >clamav-milter.sysconfig
|
||||
-### Simple config file for clamav-milter, you should
|
||||
-### read the documentation and tweak it as you wish.
|
||||
-
|
||||
-CLAMAV_FLAGS=""
|
||||
-EOF
|
||||
-
|
||||
%build
|
||||
%configure \
|
||||
--program-prefix="%{?_program_prefix}" \
|
||||
@@ -240,19 +200,30 @@
|
||||
rm -rf %{buildroot}
|
||||
make install DESTDIR="%{buildroot}"
|
||||
|
||||
-install -Dp -m0755 %{SOURCE1} %{buildroot}%{_initrddir}/clamd
|
||||
-install -Dp -m0755 freshclam.cron %{buildroot}%{_sysconfdir}/cron.daily/freshclam
|
||||
-install -Dp -m0644 freshclam.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/freshclam
|
||||
-install -Dp -m0644 clamd.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/clamav
|
||||
+install -Dp -m0755 %{SOURCE1} %{buildroot}%{_initrddir}/clamav
|
||||
+install -Dp -m0755 %{SOURCE8} %{buildroot}%{_sysconfdir}/cron.daily/freshclam
|
||||
+install -Dp -m0644 %{SOURCE7} %{buildroot}%{_sysconfdir}/logrotate.d/freshclam
|
||||
+install -Dp -m0644 %{SOURCE9} %{buildroot}%{_sysconfdir}/logrotate.d/clamav
|
||||
+
|
||||
+# now rewrite scripts and config files in-place
|
||||
+sed -i \
|
||||
+ -e 's!%%{_sbindir}!%{_sbindir}!g' \
|
||||
+ -e 's!%%{_bindir}!%{_bindir}!g' \
|
||||
+ -e 's!%%{_localstatedir}!%{_localstatedir}!g' \
|
||||
+ %{buildroot}%{_sysconfdir}/logrotate.d/* \
|
||||
+ %{buildroot}%{_sysconfdir}/cron.daily/freshclam
|
||||
|
||||
%if %{!?_without_milter:1}0
|
||||
install -Dp -m0755 %{SOURCE2} %{buildroot}%{_initrddir}/clamav-milter
|
||||
-install -Dp -m0644 clamav-milter.sysconfig %{buildroot}%{_sysconfdir}/sysconfig/clamav-milter
|
||||
+install -Dp -m0644 %{SOURCE10} %{buildroot}%{_sysconfdir}/sysconfig/clamav-milter
|
||||
%else
|
||||
rm %{buildroot}%{_mandir}/man8/clamav-milter.8*
|
||||
%endif
|
||||
+
|
||||
# Install clamav-wrapper:
|
||||
-tar xjf %{SOURCE3} -C %{buildroot}/%{_prefix}/share
|
||||
+install -d -m0755 %{buildroot}/%{_prefix}/share/clamav
|
||||
+install -m0755 -t %{buildroot}/%{_prefix}/share/clamav %{SOURCE3} %{SOURCE4}
|
||||
+install -m0444 -t %{buildroot}/%{_prefix}/share/clamav %{SOURCE5} %{SOURCE6}
|
||||
|
||||
install -d -m0755 %{buildroot}%{_localstatedir}/log/clamav/
|
||||
touch %{buildroot}%{_localstatedir}/log/clamav/freshclam.log
|
||||
@@ -345,8 +316,6 @@
|
||||
%doc %{_mandir}/man1/clamscan.1*
|
||||
%doc %{_mandir}/man1/freshclam.1*
|
||||
%doc %{_mandir}/man5/freshclam.conf.5*
|
||||
-%doc %{_prefix}/share/clamav/README.clamd-wrapper
|
||||
-%{_prefix}/share/clamav/clamd-wrapper
|
||||
%config(noreplace) %{_sysconfdir}/freshclam.conf
|
||||
%{_bindir}/clamscan
|
||||
%{_bindir}/freshclam
|
||||
@@ -366,10 +335,12 @@
|
||||
%config(noreplace) %{_sysconfdir}/clamd.conf
|
||||
%config(noreplace) %{_sysconfdir}/logrotate.d/clamav
|
||||
%{_sysconfdir}/clamd.d
|
||||
-%config %{_initrddir}/clamd
|
||||
+%config %{_initrddir}/clamav
|
||||
%{_sbindir}/clamd
|
||||
%{_bindir}/clamconf
|
||||
%{_bindir}/clamdscan
|
||||
+%doc %{_prefix}/share/clamav/README.clamd-wrapper
|
||||
+%{_prefix}/share/clamav/clamd*
|
||||
|
||||
%defattr(0644, clam, clam, 0755)
|
||||
%{_localstatedir}/run/clamav/
|
||||
@@ -409,6 +380,10 @@
|
||||
%exclude %{_libdir}/libclamav.la
|
||||
|
||||
%changelog
|
||||
+* Fri Nov 25 2011 Philip Prindeville <philipp@fedoraproject.org> - 0.97.3-2
|
||||
+- Add missing clamd-wrapper supporting files
|
||||
+- Remove from init script the unused CLAMD_SOCKET variable
|
||||
+
|
||||
* Tue Oct 18 2011 Nick Bebout <nb@fedoraproject.org> - 0.97.3-1
|
||||
- Update to 0.97.3
|
||||
- Fix CVE-2011-3627 clamav: Recursion level crash fixed in v0.97.3
|
86
clamd-wrapper
Normal file
86
clamd-wrapper
Normal file
@ -0,0 +1,86 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# chkconfig: - 75 25
|
||||
# description: The clamd daemon listens for incoming connections on \
|
||||
# Unix or TCP socket and scans files or directories on demand.
|
||||
|
||||
[ -n "$CLAMD_SERVICE" ] || {
|
||||
echo $"*** $0 can not be called in this way"
|
||||
echo $"*** Please see /usr/share/doc/clamav-server-*/README how"
|
||||
echo $"*** the clamav-server can be configured"
|
||||
exit 6
|
||||
}
|
||||
|
||||
# Source function library.
|
||||
. /etc/init.d/functions
|
||||
|
||||
# Get config.
|
||||
[ -r /etc/sysconfig/network ] && . /etc/sysconfig/network
|
||||
|
||||
# Check that networking is up.
|
||||
[ "$NETWORKING" != "no" ] || exit 6
|
||||
|
||||
lockfile=/var/lock/subsys/clamd.${CLAMD_SERVICE}
|
||||
sysconffile=/etc/sysconfig/clamd.${CLAMD_SERVICE}
|
||||
procname=clamd.${CLAMD_SERVICE}
|
||||
|
||||
CLAMD_CONFIGFILE=/etc/clamd.d/${CLAMD_SERVICE}.conf
|
||||
CLAMD_OPTIONS=
|
||||
[ -f "$sysconffile" ] && . "$sysconffile"
|
||||
CLAMD_PIDFILE=`grep ^PidFile ${CLAMD_CONFIGFILE} | awk '{print $2}'`
|
||||
|
||||
# make sure that config file contains a PidFile setting
|
||||
[ -n "$CLAMD_PIDFILE" ] || exit 6
|
||||
|
||||
RETVAL=0
|
||||
prog="clamd.${CLAMD_SERVICE}"
|
||||
|
||||
start () {
|
||||
echo -n $"Starting $prog: "
|
||||
daemon --pidfile=${CLAMD_PIDFILE} \
|
||||
exec -a $procname /usr/sbin/clamd \
|
||||
${CLAMD_CONFIGFILE:+-c $CLAMD_CONFIGFILE} ${CLAMD_OPTIONS} --pid ${CLAMD_PIDFILE}
|
||||
RETVAL=$?
|
||||
echo
|
||||
[ $RETVAL -eq 0 ] && touch $lockfile
|
||||
return $RETVAL
|
||||
}
|
||||
|
||||
stop () {
|
||||
echo -n $"Stopping $prog: "
|
||||
killproc -p ${CLAMD_PIDFILE} $procname
|
||||
RETVAL=$?
|
||||
echo
|
||||
[ $RETVAL -eq 0 ] && rm -f $lockfile
|
||||
return $RETVAL
|
||||
}
|
||||
|
||||
reload() {
|
||||
rc=0
|
||||
echo -n $"Reloading $prog: "
|
||||
killproc -p ${CLAMD_PIDFILE} $procname -SIGHUP || rc=$?
|
||||
echo
|
||||
echo -n $"Loading new virus-database: "
|
||||
killproc -p ${CLAMD_PIDFILE} $procname -SIGUSR2 || rc=$?
|
||||
echo
|
||||
return $rc
|
||||
}
|
||||
|
||||
restart () {
|
||||
stop
|
||||
start
|
||||
}
|
||||
|
||||
# See how we were called.
|
||||
case "$1" in
|
||||
start|stop|restart|reload)
|
||||
$1 ;;
|
||||
status)
|
||||
status -p ${CLAMD_PIDFILE} $procname ;;
|
||||
condrestart)
|
||||
[ ! -f $lockfile ] || restart
|
||||
;;
|
||||
*)
|
||||
echo $"Usage: $0 {start|stop|status|restart|reload|condrestart}"
|
||||
exit 2
|
||||
esac
|
18
clamd.init
Normal file
18
clamd.init
Normal file
@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
#
|
||||
# chkconfig: - 75 35
|
||||
#
|
||||
# description: The clamd server running for <SERVICE>
|
||||
#
|
||||
|
||||
CLAMD_SERVICE=<SERVICE>
|
||||
. /usr/share/clamav/clamd-wrapper
|
||||
#!/bin/bash
|
||||
#
|
||||
# chkconfig: - 75 35
|
||||
#
|
||||
# description: The clamd server running for <SERVICE>
|
||||
#
|
||||
|
||||
CLAMD_SERVICE=<SERVICE>
|
||||
. /usr/share/clamav/clamd-wrapper
|
8
clamd.logrotate
Normal file
8
clamd.logrotate
Normal file
@ -0,0 +1,8 @@
|
||||
%{_localstatedir}/log/clamav/clamd.log {
|
||||
missingok
|
||||
notifempty
|
||||
create 644 clam clam
|
||||
postrotate
|
||||
killall -HUP clamd 2>/dev/null || :
|
||||
endscript
|
||||
}
|
5
clamd.sysconfig
Normal file
5
clamd.sysconfig
Normal file
@ -0,0 +1,5 @@
|
||||
#CLAMD_CONFIGFILE=/etc/clamd.d/${CLAMD_SERVICE}.conf
|
||||
#CLAMD_OPTIONS=
|
||||
## the values below should only ever be specified in the above .conf file!
|
||||
#CLAMD_SOCKET=/var/run/clamd.${CLAMD_SERVICE}/clamd.sock
|
||||
#CLAMD_PIDFILE=/var/run/clamd.${CLAMD_SERVICE}/clamd.pid
|
34
freshclam.cron
Normal file
34
freshclam.cron
Normal file
@ -0,0 +1,34 @@
|
||||
#!/bin/sh
|
||||
|
||||
### A simple update script for the clamav virus database.
|
||||
### This could as well be replaced by a SysV script.
|
||||
|
||||
### fix log file if needed
|
||||
LOG_FILE="%{_localstatedir}/log/clamav/freshclam.log"
|
||||
if [ ! -f "$LOG_FILE" ]; then
|
||||
touch "$LOG_FILE"
|
||||
chmod 644 "$LOG_FILE"
|
||||
chown clam.clam "$LOG_FILE"
|
||||
fi
|
||||
|
||||
%{_bindir}/freshclam \
|
||||
--quiet \
|
||||
--datadir="%{_localstatedir}/lib/clamav" \
|
||||
--log="$LOG_FILE"
|
||||
#!/bin/sh
|
||||
|
||||
### A simple update script for the clamav virus database.
|
||||
### This could as well be replaced by a SysV script.
|
||||
|
||||
### fix log file if needed
|
||||
LOG_FILE="%{_localstatedir}/log/clamav/freshclam.log"
|
||||
if [ ! -f "$LOG_FILE" ]; then
|
||||
touch "$LOG_FILE"
|
||||
chmod 644 "$LOG_FILE"
|
||||
chown clam.clam "$LOG_FILE"
|
||||
fi
|
||||
|
||||
%{_bindir}/freshclam \
|
||||
--quiet \
|
||||
--datadir="%{_localstatedir}/lib/clamav" \
|
||||
--log="$LOG_FILE"
|
10
freshclam.logrotate
Normal file
10
freshclam.logrotate
Normal file
@ -0,0 +1,10 @@
|
||||
%{_localstatedir}/log/clamav/freshclam.log {
|
||||
missingok
|
||||
notifempty
|
||||
create 644 clam clam
|
||||
}
|
||||
%{_localstatedir}/log/clamav/freshclam.log {
|
||||
missingok
|
||||
notifempty
|
||||
create 644 clam clam
|
||||
}
|
Loading…
Reference in New Issue
Block a user