Re: sendmail service

From: Muhammad Rizwan Khan (rizwan_at_nixpanel.com)
Date: 02/06/04

  • Next message: Pete Nesbitt: "Re: How to use another hard disk?"
    To: redhat-list@redhat.com
    Date: Fri, 6 Feb 2004 10:45:55 +0500
    
    

    I got this script and modified a little as my requiremnet. This is very help
    full and running fine with me, if any body need it for securing his service.

    First edit crontab by following command:
    #crontab -e
    and add following line in crontab:
    0,5,10,15,20,25,30,35,40,45,50,55 * * * * /root/send.sh

    copy this script in /root/send.sh
    #!/bin/sh
    # see if the service if running
    COUNT=`ps waux |grep -v grep|grep -c sendmail`
    # if the service if running quit
    if [ $COUNT != 0 ]
    then
    echo $COUNT " is o.k. exiting..."
    # if the service is not running...
    else
    echo "sendmail is down on server... Restarting...."
    # politely stop and start the service
    /etc/rc.d/init.d/sendmail restart
    # e-page someone so they will know there was a problem
    cat /root/problem.msg |mail -s "sendmail down on your system"
    ur_name@ur_domain.com
    fi

    On Saturday 07 February 2004 18:32, Muhammad Rizwan Khan wrote:
    > Hello list!
    >
    > How i can assure that sendmail is running on my system, and if any time it
    > fails it should restart automatically.
    >
    > If i add some bash script in crond, that it 'll check the status of
    > sendmail after every 5 minutes and 'll restart it, if its not running.
    > Is there can be any problem with this idea.
    > (any body have kind of script)

    -- 
    Muhammad Rizwan Khan
    http://nixpanel.com
    MSN ID: nixpanel@hotmail.com
    -- 
    redhat-list mailing list
    unsubscribe mailto:redhat-list-request@redhat.com?subject=unsubscribe
    https://www.redhat.com/mailman/listinfo/redhat-list
    

  • Next message: Pete Nesbitt: "Re: How to use another hard disk?"

    Relevant Pages

    • Re: Sendmail mail from script (Closed)
      ... your first option works i've just add another switch -v to ... There are multiple ways to send mail from perl script. ... print SENDMAIL $_; ... Check the last portion of files. ...
      (perl.beginners)
    • Re: ssh-agent (was: using a remote IMAP server and smarthost)
      ... invokes ssh to run sendmail on myvm directly. ... here is the necessary wrapper script for method 2: ... Ssh-agent is part of the openssh-client package. ... Then you will get a dialog to enter the passphrase. ...
      (Debian-User)
    • Re: sendmail
      ... have applied your script but changed the ntpd service to sendmail. ... When the network manager dispatcher runs the script, ... It's been quite some time since I used dialup, ...
      (Fedora)
    • RE: Sendmail mail from script
      ... There are multiple ways to send mail from perl script. ... print SENDMAIL $_; ...
      (perl.beginners)
    • Redirecting an e-mail to a script
      ... Sendmail is now up and working great. ... redirect to a script. ... redirected to a script /opt/bb/bin/bb-mailack.sh. ... sendmail won't execute scripts. ...
      (Fedora)