SSH command and cron job. 'killall -9 sendmail'

Discussion in 'Site & Server Administration' started by Nintendo, Jul 25, 2009.

  1. #1
    I got sendmail shut off, yet I'm still geting this...

    10:32:06  up 23:36,  1 user,  load average: 27.08, 24.69, 18.72
    
    PID   USER      PRI  NI  SIZE  RSS SHARE STAT [b][color=red]%CPU[/color][/b] %MEM   TIME CPU COMMAND
    27911 root      19   0  2460 2452  1772  D    22.1  0.1  25:38   0 sendmail
    14904 root      19   0  2460 2452  1772  D    19.9  0.1   6:58   0 sendmail
    18063 root      18   0  2456 2448  1772  D    19.3  0.1  37:51   0 sendmail
    3611  root      18   0  2464 2456  1772  D    18.3  0.1  12:53   0 sendmail
    
    Code (markup):
    that requires a

    killall -9 sendmail

    to shut it off.

    Is it possible to make a cron job run the SSH command

    killall -9 sendmail

    at say 5 and 35 minutes after the hour?
     
    Nintendo, Jul 25, 2009 IP
    bogart likes this.
  2. Bohra

    Bohra Prominent Member

    Messages:
    12,573
    Likes Received:
    537
    Best Answers:
    0
    Trophy Points:
    310
    #2
    Create a .sh file for eg name it sendmail.sh put that command in that file and put the cron to that file
     
    Bohra, Jul 26, 2009 IP
  3. thuankkk

    thuankkk Active Member

    Messages:
    503
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    95
    #3
    Enter crontab -e
    Insert
    5,35 * * * * killall -9 sendmail
    Press Esc, :, x, enter.
    Now you're fine of sendmail.

    If you installed webmin, you can change the Max load average for sending setting, or try editting /etc/mail/sendmail.cf
     
    thuankkk, Jul 26, 2009 IP
  4. SA-ChrisM

    SA-ChrisM Peon

    Messages:
    7
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I'd say there's a bigger problem here. First of all, the only way sendmail would be consuming that many resources is if it were sending (or receiving) a large amount of email. You might want to watch your mail log file and see exactly what it's doing. Typically this would be in /var/log/maillog and you can watch it in realtime by doing 'tail -f /var/log/maillog'.

    As to fully shutting it off, if this is a RedHat based system (Redhat/CentOS/etc) you can do 'chkconfig sendmail off; service sendmail stop'
     
    SA-ChrisM, Jul 29, 2009 IP
  5. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #5
    Thanks. The

    04 * * * * root killall -9 sendmail
    34 * * * * root killall -9 sendmail

    stoped it. I got a vBulletin forum on the server, so as long as this works, I don't want to completly shut it off.

    For checking the logs for errors, one error is

    Jul 25 13:55:32 ensim sendmail[24849]: grew WorkList for /home/virtual/FILESYSTEMTEMPLATE/services/sendmail/mqueue.scanned to 45000

    looks like there's a ton of messages there. The directory is way too big for me to look at it through ftp to see if it's safe to do a

    rm -f /home/virtual/FILESYSTEMTEMPLATE/services/sendmail/mqueue.scanned/*
     
    Nintendo, Jul 31, 2009 IP
  6. ravee1981

    ravee1981 Active Member

    Messages:
    712
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    60
    #6
    im sorry, but ive never got the -9 option working for me. shouldnt you be killing the pid?
     
    ravee1981, Aug 4, 2009 IP