![]() |
Previous | TOC | Next | ![]() |
![]() | Technical document: Virus detection with Clam Antivirus |
| Appendix A - Clam Antivirus startup and shutdown script | |
#!/bin/sh
###########################################################################
# CONFIGURATION
# Most configuration options are found in the clamd.conf file.
# For more info see:
# man clamd.conf
# The user to run as
user=clamav
# The prefix clamd was installed to
prefix=/usr/local/sbin
# The location for pid file
piddir=/var/run/clamav
###########################################################################
# SCRIPT
case $1 in
start)
echo "Starting clamd"
mkdir -p $piddir
chown $user $piddir
su -m $user -c "$prefix/clamd"
;;
stop)
echo "Stopping clamd"
[ -f $piddir/clamd.pid ] && kill `cat $piddir/clamd.pid`
;;
*)
echo "usage: clamd.sh { start | stop }" >&2
;;
esac
![]() |
Previous: Chapter 2 - Setting up ClamSMTP | TOC | Next: Appendix B - Freshclam startup and shutdown script | ![]() |