Hello Stephen,
[You might want to quickly read to the end of this mail first. :-)]
Stephen Gran wrote:
> # ls -la /var/run/clamav/ > total 8 > drwxr-xr-x 2 root root 4096 Feb 8 02:24 . > drwxr-xr-x 13 root root 4096 Feb 9 16:26 ..
Edit /var/lib/dpkg/info/clamav-base.postinst, and change #!/bin/sh to #!/bin/sh -x. Then run dpkg-reconfigure clamav-base and send me the output. This should have been handled automatically, but I would like to see what went wrong.
Hey, I didn't know about /var/lib/dpkg/info so far. Guess I should try to get around to reading that Debian policy...
I had a look through the postinst script, then tried to reconstruct what probably happened here. Then I stopped all the services and tried the following:
==== Begin ====
quantum3:~# rmdir /var/run/clamav quantum3:~# apt-get install --reinstall clamav-base Reading Package Lists... Done Building Dependency Tree... Done 0 packages upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 1 not upgraded. Need to get 0B/113kB of archives. After unpacking 0B will be used. Do you want to continue? [Y/n] (Reading database ... 35400 files and directories currently installed.) Preparing to replace clamav-base 0.82-1 (using .../clamav-base_0.82-1_all.deb) ... Unpacking replacement clamav-base ... Setting up clamav-base (0.82-1) ...
quantum3:~# ls -la /var/run/clamav total 8 drwxr-xr-x 2 root root 4096 Feb 8 02:24 . drwxr-xr-x 13 root root 4096 Feb 11 15:24 ..
===== End =====
So after a supposedly "fresh" install of clamav-base, permissions were incorrect.
I added the trace option to the postinst script and ran it:
==== Begin ====
quantum3:~# dpkg-reconfigure clamav-base + set -e + DATABASEDIR=/var/lib/clamav + RUNDIR=/var/run/clamav + LOGDIR=/var/log/clamav + '[' -z 0.82-1 ']' + '[' -e /etc/clamav/clamd.conf ']' + clamconf=/etc/clamav/clamd.conf + '[' -f /etc/aliases -o -L /etc/aliases ']' + grep -qi '^clamav' /etc/aliases + '[' -n /etc/clamav/clamd.conf ']' ++ grep '^User ' /etc/clamav/clamd.conf ++ awk '{print $2}' + user=clamav + '[' -z clamav ']' ++ grep '^PidFile ' /etc/clamav/clamd.conf ++ awk '{print $2}' + run=/var/run/clamav/clamd.pid + '[' -n /var/run/clamav/clamd.pid ']' ++ dirname /var/run/clamav/clamd.pid + rundir=/var/run/clamav ++ grep '^DatabaseDirectory ' /etc/clamav/clamd.conf ++ awk '{print $2}' + data=/var/lib/clamav/ + '[' -n /var/lib/clamav/ ']' + datadir=/var/lib/clamav/ ++ grep '^LogFile ' /etc/clamav/clamd.conf ++ awk '{print $2}' + log=/var/log/clamav/clamav.log + '[' -n /var/log/clamav/clamav.log ']' ++ dirname /var/log/clamav/clamav.log + logdir=/var/log/clamav + '[' /var/run/clamav = /var/run/clamav -a /var/lib/clamav/ = /var/lib/clamav -a /var/log/clamav = /var/log/clamav ']' + exit 0
===== End =====
No mention of a "chown" in there. Looks like the test in line 85 failed because DatabaseDirectory in "/etc/clamav/clamd.conf" is set to "/var/lib/clamav/" -- which is not equal to "/var/lib/clamav".
The conf file's first line reads: #Automatically Generated by clamav-daemon postinst
and I'm pretty sure I didn't touch it.
Cheers, Marcus
-- Marcus C. Gottwald <[EMAIL PROTECTED]> Quantum Hydrometrie GmbH, Berlin
-- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]