myH2Oservers
Verified User
This howto shows you how to control (start/stop/restart) clamav from the DirectAdmin Service Monitor screen:
This has been tested with Debian 3.1 and works, it is possible that you have to edit the program lines in the control script to make it work with any other OS
Edit:
Add:
Edit:
Add:
Edit:
Change:
Edit:
Change:
Test it:
If there are no errors:
Only need to know how to get ClamAV visible in the "System Information" window.
This has been tested with Debian 3.1 and works, it is possible that you have to edit the program lines in the control script to make it work with any other OS
Edit:
Code:
nano /usr/local/directadmin/data/admin/services.status
Code:
clamd=ON
Edit:
Code:
nano /etc/init.d/clamd
Code:
#!/bin/sh
# Start/stop/restart clamav.
# Start clamav:
clamav_start() {
if [ -x /usr/local/sbin/clamd ]; then
echo "Starting clamd daemon: /usr/local/sbin/clamd"
/usr/local/sbin/clamd
# Give clamd a change to make the socket
sleep 1
echo "Starting freshclam daemon: /usr/local/bin/freshclam -d -c 6"
/usr/local/bin/freshclam -d -c 6
fi
}
# Stop clamav:
clamav_stop() {
kill `cat /var/run/clamav/clamd.pid`
kill `cat /var/run/clamav/freshclam.pid`
}
# Restart clamav:
clamav_restart() {
clamav_stop
sleep 1
clamav_start
}
case "$1" in
'start')
clamav_start
;;
'stop')
clamav_stop
;;
'restart')
clamav_restart
;;
*)
echo "usage $0 start|stop|restart"
esac
Edit:
Code:
nano /etc/clamd.conf
Code:
#PidFile /var/run/clamd.pid --> PidFile /var/run/clamav/clamd.pid
Edit:
Code:
nano /etc/freshclam.conf
Code:
#PidFile /var/run/freshclam.pid --> PidFile /var/run/clamav/freshclam.pid
Code:
mkdir -p var/run/clamav
chown -R clamav:clamav /var/run/clamav
chmod -R 700 /var/run/clamav
Test it:
Code:
/etc/init.d/clamd stop
/etc/init.d/clamd start
Code:
/etc/init.d/exim restart
Only need to know how to get ClamAV visible in the "System Information" window.
Last edited: