On Sun, 2016-08-07 at 15:57 +0200, Reindl Harald wrote:
> 
> 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@localhost:~$ sudo service clamav-daemon stop  [ - ]  clamav-
> > daemon
> > 
> > chris@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@mail-gw:~]$ cat /etc/tmpfiles.d/clamd.conf
> d /run/clamd 0775 clamscan clamilt
> 
> [root@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@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
> 
According to the example file that I have in my /etc/clamav folder the
path for the socket they have is - #LocalSocket /tmp/clamd.socket

I changed my /etc/clamav/clamd.conf to read the path as
/run/clamd.socket. Stopped and restarted the clamav-daemon. The file
clamd.ctl is updated in /run/clamav however the socket file is still
not created anywhere no matter what path I use. Of course this happens
when freshclam detects a change - Clamd was NOT notified: Can't connect
to clamd through /run/clamd.socket: No such file or directory


-- 
Chris
KeyID 0xE372A7DA98E6705C
31.11972; -97.90167 (Elev. 1092 ft)
09:16:53 up 12:41, 1 user, load average: 0.46, 0.28, 0.34
Ubuntu 16.04.1 LTS, kernel 4.4.0-31-generic #50-Ubuntu SMP Wed Jul 13 00:07:12 
UTC 2016

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

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

Reply via email to