Edilmar LISTAS wrote:
> Hi,
>
> I have used clamd for many years with Fedora, RedHat and CentOS.
> And I have a updating script that always copy "clamd" init script file
> for current version to init.d subdir.
> This script always worked fine, but now in 0.95 this contrib file isn't
> there.
> I put the script from a previous version 0.93 and it worked fine.
> _______________________________________________
> Help us build a comprehensive ClamAV guide: visit http://wiki.clamav.net
> http://www.clamav.net/support/ml
Such scripts are rather easily constructed using a basic template:
----------------
#!/bin/sh
# set environment variables
# example:
LD_LIBRARY_PATH="/somewhere/over/the/rainbow:/usr/lib"
ClamdOptions="--this --that --whatever"
# To encourage anal behavior
unalias start
unalias stop
unalias restart
start()
{
# do stuff to start the product
/usr/sbin/clamd $ClamdOptions && \
echo "clamd startup attempted"
}
stop()
{
# do stuff to stop the product
/usr/bin/pkill -x -u clamav clamd &&\
echo "clamd shutdown attempted"
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
# don't restart it if we don't kill it successfully
stop && start
;;
*)
echo "Usage: blah [start|stop|restart]
;;
exit
esac
exit
---------------
Additional lines of code can be added to verify the star or stop actually
happened but generally the above is often enough.
dp
_______________________________________________
Help us build a comprehensive ClamAV guide: visit http://wiki.clamav.net
http://www.clamav.net/support/ml