Login
Log in using an SSO provider:
Fedora Account System
Red Hat Associate
Red Hat Customer
Login using a Red Hat Bugzilla account
Forgot Password
Create an Account
Red Hat Bugzilla – Attachment 550216 Details for
Bug 771025
clamd-0.97.3-2.el6 breaks clamd init script
Home
New
Search
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh92 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
[?]
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Redux of earlier patch
clamav.patch (text/plain), 11.09 KB, created by
Philip Prindeville
on 2012-01-02 09:28:16 UTC
(
hide
)
Description:
Redux of earlier patch
Filename:
MIME Type:
Creator:
Philip Prindeville
Created:
2012-01-02 09:28:16 UTC
Size:
11.09 KB
patch
obsolete
>diff --git a/README.clamd-wrapper b/README.clamd-wrapper >new file mode 100644 >index 0000000..e62b487 >--- /dev/null >+++ b/README.clamd-wrapper >@@ -0,0 +1,58 @@ >+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!] >diff --git a/clamav-milter.sysconfig b/clamav-milter.sysconfig >new file mode 100644 >index 0000000..834b0cd >--- /dev/null >+++ b/clamav-milter.sysconfig >@@ -0,0 +1,4 @@ >+### Simple config file for clamav-milter, you should >+### read the documentation and tweak it as you wish. >+ >+CLAMAV_FLAGS="" >diff --git a/clamav.spec b/clamav.spec >index ba4b951..1cb2ccf 100644 >--- a/clamav.spec >+++ b/clamav.spec >@@ -5,7 +5,7 @@ > Summary: Anti-virus software > Name: clamav > Version: 0.97.3 >-Release: 3%{?dist} >+Release: 4%{?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.cron >+Source8: freshclam.logrotate >+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}" \ >@@ -241,18 +201,29 @@ 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 %{SOURCE7} %{buildroot}%{_sysconfdir}/cron.daily/freshclam >+install -Dp -m0644 %{SOURCE8} %{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 >@@ -370,6 +339,8 @@ rm -rf %{buildroot} > %{_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,9 @@ rm -rf %{buildroot} > %exclude %{_libdir}/libclamav.la > > %changelog >+* Sun Jan 1 2012 Philip Prindeville <philipp@fedoraproject.org> - 0.97.3-4 >+- Redux of bz#756854. >+ > * Sun Jan 1 2012 Nick Bebout <nb@fedoraproject.org> - 0.97.3-3 > - Revert patch from 0.97.3-2 > >diff --git a/clamd-wrapper b/clamd-wrapper >new file mode 100644 >index 0000000..000dcb8 >--- /dev/null >+++ b/clamd-wrapper >@@ -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 >diff --git a/clamd.init b/clamd.init >new file mode 100644 >index 0000000..09970d4 >--- /dev/null >+++ b/clamd.init >@@ -0,0 +1,9 @@ >+#!/bin/bash >+# >+# chkconfig: - 75 35 >+# >+# description: The clamd server running for <SERVICE> >+# >+ >+CLAMD_SERVICE=<SERVICE> >+. /usr/share/clamav/clamd-wrapper >diff --git a/clamd.logrotate b/clamd.logrotate >new file mode 100644 >index 0000000..b233f3a >--- /dev/null >+++ b/clamd.logrotate >@@ -0,0 +1,8 @@ >+%{_localstatedir}/log/clamav/clamd.log { >+ missingok >+ notifempty >+ create 644 clam clam >+ postrotate >+ killall -HUP clamd 2>/dev/null || : >+ endscript >+} >diff --git a/clamd.sysconfig b/clamd.sysconfig >new file mode 100644 >index 0000000..e0e7714 >--- /dev/null >+++ b/clamd.sysconfig >@@ -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 >diff --git a/freshclam.cron b/freshclam.cron >new file mode 100644 >index 0000000..e40d8ef >--- /dev/null >+++ b/freshclam.cron >@@ -0,0 +1,17 @@ >+#!/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" >diff --git a/freshclam.logrotate b/freshclam.logrotate >new file mode 100644 >index 0000000..272d220 >--- /dev/null >+++ b/freshclam.logrotate >@@ -0,0 +1,5 @@ >+%{_localstatedir}/log/clamav/freshclam.log { >+ missingok >+ notifempty >+ create 644 clam clam >+} >diff --git a/sources b/sources >index 47b00bc..05755a5 100644 >--- a/sources >+++ b/sources >@@ -1,2 +1 @@ > b319a3f31a16811f1a92d63cda592521 clamav-0.97.3-norar.tar.xz >-e809f74ed139df2e4af3fafbca32f678 clamd-wrapper.tar.bz2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 771025
: 550216