Matt Blecha wrote: > Hi Everyone! > > I guess my first post should include something useful, so I hope > this would be it... Here are some nifty initscripts written on, and > compatible with RedHat, specifically 8.0, but should work under > RedHats from about 6.0 to whatever.... > > > make sure to copy clamd-init & freshclam-init to > /etc/rc.d/init.d/clamd & /etc/rc.d/init.d/freshclam or whatever, then > copy clamd-sysconfig & freshclam-sysconfig to /etc/sysconfig/clamd & > /etc/sysconfig/freshclam > > pretty sinple scripts, works like all the others, but is cloned from > the crond initscript, so has a few more bits of functionality... > > the sysconfig/* files are structured this way: > > progdir=/path/to/clamd/or/freshclam > > specific to freshclam: > > checks=[integer between 1 and 50 representing number of times to check > for clam database updates] > > > Any questions, or requests to build in, simply ask, and ye shall > recieve... > > > -Matt Blecha- > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED]
Oops! Helps if I include the initscripts... -Matt #! /bin/bash # # crond Start/Stop the clam antivirus daemon. # # chkconfig: 2345 90 60 # description: clamdis a standard UNIX program that scans for Viruses. # processname: clamd # config: /usr/local/etc/clamd.conf # pidfile: /var/lock/subsys/clamd # Source function library. . /etc/init.d/functions RETVAL=0 # See how we were called. prog="clamd" # Source configuration if [ -f /etc/sysconfig/$prog ] ; then . /etc/sysconfig/$prog fi start() { echo -n $"Starting $prog: " daemon $progdir/$prog RETVAL=$? echo [ $RETVAL -eq 0 ] && touch /var/lock/subsys/clamd return $RETVAL } stop() { echo -n $"Stopping $prog: " killproc $prog RETVAL=$? echo [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/clamd return $RETVAL } rhstatus() { status clamd } restart() { stop start } reload() { echo -n $"Reloading clam daemon configuration: " killproc clamd -HUP retval=$? echo return $RETVAL } case "$1" in start) start ;; stop) stop ;; restart) restart ;; reload) reload ;; status) rhstatus ;; condrestart) [ -f /var/lock/subsys/clamd ] && restart || : ;; *) echo $"Usage: $0 {start|stop|status|reload|restart|condrestart}" exit 1 esac exit $? progdir=/usr/local/sbin #! /bin/bash # # crond Start/Stop the clam antivirus daemon. # # chkconfig: 2345 90 60 # description: clamdis a standard UNIX program that scans for Viruses. # processname: clamd # config: /usr/local/etc/clamd.conf # pidfile: /var/lock/subsys/clamd # Source function library. . /etc/init.d/functions RETVAL=0 # See how we were called. prog="freshclam" # Source configuration if [ -f /etc/sysconfig/$prog ] ; then . /etc/sysconfig/$prog fi start() { echo -n $"Starting $prog: " daemon $progdir/$prog -d -c$checks RETVAL=$? echo [ $RETVAL -eq 0 ] && touch /var/lock/subsys/freshclam return $RETVAL } stop() { echo -n $"Stopping $prog: " killproc $prog RETVAL=$? echo [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/freshclam return $RETVAL } rhstatus() { status freshclam } restart() { stop start } reload() { echo -n $"Reloading freshclam daemon configuration: " killproc freshclam -HUP retval=$? echo return $RETVAL } case "$1" in start) start ;; stop) stop ;; restart) restart ;; reload) reload ;; status) rhstatus ;; condrestart) [ -f /var/lock/subsys/freshclam ] && restart || : ;; *) echo $"Usage: $0 {start|stop|status|reload|restart|condrestart}" exit 1 esac exit $? checks=4 progdir=/usr/local/bin --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]