Mailing List Archive

[clamav-users] create /var/run/clamav on reboot in Fedora, otherwise Pulseaudio errors occur
Using Fedora 31, this has been happening for quite a while. After reboot
/var/run/clamav is removed, which is expected. However, wehn ClamAV was
installed the user created in /etc/passwd looks like this:
clamav:x:985:981::/var/run/clamav:/sbin/nologin

So Pulseaudio tries to create the following directories/files:

Aug 5 10:14:02 myuser pulseaudio[1392074]: E: [pulseaudio] core-util.c:
Failed to create secure directory (/var/run/clamav/.config/pulse): No such
file or directory
Aug 5 10:14:02 myuser systemd[1392030]: pulseaudio.service: Main process
exited, code=exited, status=1/FAILURE
Aug 5 10:14:02 myuser systemd[1392030]: pulseaudio.service: Failed with
result 'exit-code'.
Aug 5 10:14:02 myuser systemd[1392030]: Failed to start Sound Service.
Aug 5 10:14:02 myuser systemd[1392030]: pulseaudio.service: Scheduled
restart job, restart counter is at 2.
Aug 5 10:14:02 myuser systemd[1392030]: Stopped Sound Service.
Aug 5 10:14:02 myuser systemd[1392030]: Starting Sound Service...

So a work-around I've found
<https://bugzilla.redhat.com/show_bug.cgi?id=1312035#c2> is to update
/lib/systemd/system/clamd.service with:

ExecStartPre = /usr/bin/mkdir -p /var/run/clamav
ExecStartPre = /usr/bin/chown -R clamav.clamav /var/run/clamav

Is this a known issue?
Re: [clamav-users] create /var/run/clamav on reboot in Fedora, otherwise Pulseaudio errors occur [ In reply to ]
Citeren Robert Kudyba <rkudyba@fordham.edu>:

> Using Fedora 31, this has been happening for quite a while. After reboot
> /var/run/clamav is removed, which is expected. However, wehn ClamAV was
> installed the user created in /etc/passwd looks like this:
> clamav:x:985:981::/var/run/clamav:/sbin/nologin
>
> So Pulseaudio tries to create the following directories/files:
>
> Aug 5 10:14:02 myuser pulseaudio[1392074]: E: [pulseaudio] core-util.c:
> Failed to create secure directory (/var/run/clamav/.config/pulse): No such
> file or directory
> Aug 5 10:14:02 myuser systemd[1392030]: pulseaudio.service: Main process
> exited, code=exited, status=1/FAILURE
> Aug 5 10:14:02 myuser systemd[1392030]: pulseaudio.service: Failed with
> result 'exit-code'.
> Aug 5 10:14:02 myuser systemd[1392030]: Failed to start Sound Service.
> Aug 5 10:14:02 myuser systemd[1392030]: pulseaudio.service: Scheduled
> restart job, restart counter is at 2.
> Aug 5 10:14:02 myuser systemd[1392030]: Stopped Sound Service.
> Aug 5 10:14:02 myuser systemd[1392030]: Starting Sound Service...
>
> So a work-around I've found
> <https://bugzilla.redhat.com/show_bug.cgi?id=1312035#c2> is to update
> /lib/systemd/system/clamd.service with:
>
> ExecStartPre = /usr/bin/mkdir -p /var/run/clamav
> ExecStartPre = /usr/bin/chown -R clamav.clamav /var/run/clamav
>
> Is this a known issue?

This is not the right solution. See

https://fedoraproject.org/wiki/Packaging:Tmpfiles.d

how to correctly set this up under systemd. Whoever packaged this in
Fedora with this configuration, should set this up in the package
instead.


_______________________________________________

clamav-users mailing list
clamav-users@lists.clamav.net
https://lists.clamav.net/mailman/listinfo/clamav-users


Help us build a comprehensive ClamAV guide:
https://github.com/vrtadmin/clamav-faq

http://www.clamav.net/contact.html#ml
Re: [clamav-users] create /var/run/clamav on reboot in Fedora, otherwise Pulseaudio errors occur [ In reply to ]
Robert Kudyba wrote:
> Using Fedora 31, this has been happening for quite a while. After reboot
> /var/run/clamav is removed, which is expected. However, wehn ClamAV was
> installed the user created in /etc/passwd looks like this:
> clamav:x:985:981::/var/run/clamav:/sbin/nologin
>
> So Pulseaudio tries to create the following directories/files:

In my opinion the bug lies in PulseAudio in doing whatever it's doing
that needs to create files in the clamav user's home directory at all.
ClamAV itself has no audio components that I know of (it might be
generally "aware" of audio file types, if there are viruses that abuse
them), so PulseAudio should not be doing anything in the clamav user's
home directory. (Or any other similar system user's home directory, for
that matter.)

Creating /var/run/clamav earlier in the boot process - by whatever means
- just papers over the real problem of some process accessing something
it shouldn't be touching in the first place. Not to mention the fact
that ~/.config is the "Latest and Most Bestest(TM)" place for various
tools to file their per-user configuration files; it's supposed to be
persistent, which /var/run/clamav very intentionally isn't.

-kgd


_______________________________________________

clamav-users mailing list
clamav-users@lists.clamav.net
https://lists.clamav.net/mailman/listinfo/clamav-users


Help us build a comprehensive ClamAV guide:
https://github.com/vrtadmin/clamav-faq

http://www.clamav.net/contact.html#ml