[clamav-users] Error (Cannot connect to unix socket '/var/lib/clamav/clamd.socket': connect: No such file or directory)

Reindl Harald h.reindl at thelounge.net
Sun Aug 7 09:57:02 EDT 2016



Am 07.08.2016 um 15:51 schrieb Chris:
> On Sun, 2016-08-07 at 10:49 +0200, Tobi wrote:
>> It might a systemd issue. Have you tried to start clamd by calling it
>> directly on cli? Does it create the socket then?
>>
>> Cheers
>>
>> tobi
>
> I've tried that lots of times Tobi, however, it still doesn't create
> it:
>
> chris at localhost:~$ sudo service clamav-daemon stop  [ - ]  clamav-
> daemon
>
> chris at localhost:~$ sudo service clamav-daemon start [ + ]  clamav-
> daemon
>
> The 'clamd.socket' file should be between these two but it's not:
>
> -rw-r--r--  1 clamav clamav    446464 Jun 23 11:40 bytecode.cld
> -rw-r--r--  1 clamav clamav        82 Jul 13 14:44 crdfam.clamav.hdb

that's why /run exists these days - socketfiles don't belong anywhere else


[root at mail-gw:~]$ cat /etc/tmpfiles.d/clamd.conf
d /run/clamd 0775 clamscan clamilt

[root at mail-gw:~]$ ls /run/clamd
insgesamt 0
srw-rw-rw- 1 clamscan clamilt 0 2016-08-05 10:37 clamd-sa.sock
srw-rw-rw- 1 clamscan clamilt 0 2016-08-05 10:37 clamd.sock

clamscan 32460  0.2 12.3 949464 500444 ?       SNsl Aug05   7:35 
/usr/sbin/clamd -c /etc/clamd.d/scan-sa.conf
clamscan 32559  0.2  9.8 900756 400288 ?       SNsl Aug05   7:10 
/usr/sbin/clamd -c /etc/clamd.d/scan.conf
______________________________________

[root at mail-gw:~]$ cat /etc/systemd/system/clamd-sa.service
[Unit]
Description=ClamAV Scanner Daemon for SpamAssassin
Before=spamassassin.service

[Service]
Type=forking
Environment="TMPDIR=/tmp"
Environment="LANG=en_GB.UTF-8"
ExecStart=/usr/sbin/clamd -c /etc/clamd.d/scan-sa.conf
ExecReload=/usr/bin/kill -SIGUSR2 $MAINPID
Restart=always
RestartSec=1
Nice=5

User=clamscan
Group=clamilt

PrivateTmp=yes
PrivateDevices=yes
PrivateNetwork=no
NoNewPrivileges=yes
CapabilityBoundingSet=CAP_KILL
RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6
SystemCallArchitectures=x86-64
SystemCallFilter=~acct modify_ldt add_key adjtimex clock_adjtime 
delete_module fanotify_init finit_module get_mempolicy init_module 
io_destroy io_getevents iopl ioperm io_setup io_submit io_cancel kcmp 
kexec_load keyctl lookup_dcookie mbind migrate_pages mount move_pages 
open_by_handle_at perf_event_open pivot_root process_vm_readv 
process_vm_writev ptrace remap_file_pages request_key set_mempolicy 
swapoff swapon umount2 uselib vmsplice

ReadOnlyDirectories=/
ReadWriteDirectories=/run/clamd.scan
ReadWriteDirectories=/run/clamd
ReadWriteDirectories=/var/log
ReadWriteDirectories=/tmp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: OpenPGP digital signature
URL: <https://lists.clamav.net/pipermail/clamav-users/attachments/20160807/3b3d7d41/attachment.sig>


More information about the clamav-users mailing list