[Avcheck] kavdaemon init Skript

Michael Tokarev Avcheck list <avcheck@list.innominate.org>
Wed, 15 Aug 2001 16:56:27 +0400


Ralf Hildebrandt wrote:
> 
> Am 15.08.2001 um 14:30:52 +0200 schrieb Fridtjof Busse folgendes:
> 
> > I wrote a similar script for redhat (only some other definitions and
> > calls lie 'daemon' and 'killproc') and there is still one problem: What
> > if you are running a second kavdaemon for file-scanning on the same
> > system? You are killing this one also and it won't restart...
> > OK, I could include a start script for this daemon too, but this is no
> > real solution.
> 
> 2nd try (attached). Please try if it kills just the chrooted instance
> or all instances!
> 
> --
> Ralf.Hildebrandt@innominate.com                           innominate AG
> +49.(0)30.308806-62  fax: -77                         networking people
> Any host that rejects 8bit mail for no particular reason other then
> trying to enforce use of 7bit mail is stupid!
> 
>   ----------------------------------------------------------------------------------------------------
> 
>    kavdaemonName: kavdaemon
>             Type: Plain Text (text/plain)

> pid=`ps ax | awk '{print $1,$5}' | grep $DAEMONNAME | awk '{print $1}' | awk '{print $1}'`

I was always curious why people uses so complicated command to find
a pid of process (note double last awks).  Should this be simple like
(untested, just the "idea")"

  pid=`ps ax | awk "/$DAEMONNAME/ { print $1 }"`

Or, better yet,

  ps -u avpd | awk "$4 == \"$DAEMONNAME\" { print $1; }"

The same can be done with sed, e.g.

  ps -u avpd | sed -n "s|^\\([0-9]*\\) .* $DAEMONNAME\$|\\1|p"

[]
                ./$DAEMONNAME -dl -MD -MP -dp -V -* -f=/ctl /tst 

 -MD (check mail databases) is redundrand, but (as stated in docs)
will slow avpdaemon significantly.  "Mail databases" are things like
MS Exchange / Outlook / whatether mail storage, if I understand this
correctly.

 -MP -- yes, this is what needed, but can be configured in .ini file
(and -MD too).

 -dp - disable using AvpPid file -- wow, this one is for more work!
It will write it's AvpPid in /var/spool/avp/ctl/AvpPid, and thus easy
to find, no ps/grep/awk logic anymore! ;)

 -* -- be careful with this, better yet include it in quotes.  Anyway,
it is useless.

I'm sorry I have no time now (and wow, i installing drweb right now! ;)

Regards,
 miichael/