Bug 790042

Summary: clamav+systemd=Can't create temporary directory ERROR
Product: [Fedora] Fedora Reporter: Nicolas Mailhot <nicolas.mailhot>
Component: clamavAssignee: Enrico Scholz <rh-bugzilla>
Status: CLOSED DUPLICATE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: nb, ondrejj, philipp, redhat-bugzilla, rh-bugzilla, steve, systemd-maint
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-02-28 08:58:51 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Nicolas Mailhot 2012-02-13 14:40:10 UTC
clamav's sysv amavisd-new service does not work anymore

/etc/init.d/clamd.amavisd: line 7: /usr/share/clamav/clamd-wrapper: No such file or directory

I figured it was a good time to switch to the systemd unit, and indeed it starts up fine

However it seems to have problems creating temporary files

 clamd[3637]: /var/spool/amavisd/tmp/amavis-20120211T120007-01177/parts/p002:
Can't create temporary directory ERROR

Maybe the systemd clamav unit needs some more magic to work with systemd's PrivateTmp feature?

(clamav amavisd conf taken from the amavisd-new package)

Version-Release number of selected component (if applicable):

amavisd-new-2.6.6-2.fc17.noarch
clamav-0.97.3-1703.fc17.x86_64
clamav-data-empty-0.97.3-1703.fc17.noarch
clamav-filesystem-0.97.3-1703.fc17.noarch
clamav-lib-0.97.3-1703.fc17.x86_64
clamav-server-0.97.3-1703.fc17.x86_64
clamav-server-systemd-0.97.3-1703.fc17.noarch
clamav-update-0.97.3-1703.fc17.x86_64
systemd-42-1.fc17.x86_64

Comment 1 Enrico Scholz 2012-02-15 10:55:01 UTC
fwiw, the clamd-wrapper script is now in the clamav-server-sysvinit package (which is going to die in the midterm).

Can you point me to the mentioned systemd unit please? amavisd-new git does not contain a such one.

I am in doubt that your problem is caused by PrivateTmp, because this affects /tmp only, not /var/spool/...  Nevertheless, you can verify this by disabling PrivateTmp in the systemd unit (either clamd@.service, or in your clamd@<instance>.service file).

Comment 2 Nicolas Mailhot 2012-02-15 12:20:43 UTC
(In reply to comment #1)
> fwiw, the clamd-wrapper script is now in the clamav-server-sysvinit package
> (which is going to die in the midterm).

That breaks amavid as it does not depend on this new package (but should move to systemd anyway → bug #789571)

> Can you point me to the mentioned systemd unit please? amavisd-new git does not
> contain a such one.

I just used the one in clamav systemd
systemctl start clamd (IIRC) and it picked up the clamav config file shipped with the amavisd-new packages

ln -sf /lib/systemd/system/clamd@.service
/etc/systemd/system/multi-user.target.wants/clamd

Only problems are those new tmp files errors (that didn't happen with the old sysv script): maybe it's the same as bug #790522 ?

and the pid file instruction in the amavisd-new config (is it necessary with systemd? Selinux does not like it: bug #789580)

Comment 3 Enrico Scholz 2012-02-17 14:00:24 UTC
is this fixed by 790522#c19 ?

Creation of the pidfile can/should be avoided unless amavisd or system monitoring needs it.

Comment 4 Nicolas Mailhot 2012-02-17 15:07:09 UTC
(In reply to comment #3)
> is this fixed by 790522#c19 ?
> 
> Creation of the pidfile can/should be avoided unless amavisd or system
> monitoring needs it.

the temporary file creation is indeed fixed by the new systemd

So, if you confirm there is no need to create the pid file, I should just ask the amavisd maintainer to remove the pid directive and use the generic clamav systemd unit, right?

Comment 5 Nicolas Mailhot 2012-02-28 08:58:51 UTC

*** This bug has been marked as a duplicate of bug 790522 ***