NETWORK PRESENCE ABOUT SERVICES PRODUCTS TRAINING CONTACT US SEARCH SUPPORT
 


Search
display results
words begin  exact words  any words part 

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [FW1] automating script to restart MDQ



Aloha,

First of all don't use csh for scripts. it just doesn't work.

Try this script
#!/bin/ksh
# uncomment one and only one of the following statements to set the pid
variable.
# the first is a Linux and the second is Solaris this script works on
either. with the
# correct ps statement
#pid=`ps -aux | grep mdq | grep -v grep | awk '{print $2}'`
#pid=`ps -ef | grep mdq | grep -v grep | awk '{print $2}'`

        if /usr/bin/test "$pid"
        then
                kill $pid
        fi

----- Original Message -----
From: <[email protected]>
To: <[email protected]>
Sent: Wednesday, September 27, 2000 9:22 AM
Subject: [FW1] automating script to restart MDQ


>
> Hi All,
>
> I have a script but it does not seem to work. I also need to automate the
> script to
> run every 60 minutes through some kind of cron job.  Can you tell me what
is
> wrong with the script and how can I automate it. I would appreciate a
quick
> response.
>
> Here is the script (restartmdq) I have written.
>
>
> #!/bin/csh
> # restart mdq... pick up any "forgotten" mail
> # ---------------------------------------------------------------
>  set pid = ( ps ugxaw | grep mdq | grep -v grep | awk '{print $2}' )
>  if ( "$pid" != "" ) then
>      kill "$pid"
>  endif
> # FW-1 in.asmtpd will automatically restart another mdq
>
>
>
> When I type set I don't see the pid being set to the mdq pid.
>
> Can someone help. We are having to manually restart the mdq process.
>
> Thanks in advance
>
> Kamran
>
>
>
>
>
============================================================================
====
>      To unsubscribe from this mailing list, please see the instructions at
>                http://www.checkpoint.com/services/mailing.html
>
============================================================================
====



================================================================================
     To unsubscribe from this mailing list, please see the instructions at
               http://www.checkpoint.com/services/mailing.html
================================================================================



 
----------------------------------

ABOUT SERVICES PRODUCTS TRAINING CONTACT US SEARCH SUPPORT SITE MAP LEGAL
   All contents � 2003 Network Presence, LLC. All rights reserved.