LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 06-14-2012, 05:35 PM   #16
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604

Rep: Reputation: 415Reputation: 415Reputation: 415Reputation: 415Reputation: 415

that email is being sent to you ONLY if it starts it up. You can modify this echo statement at the end of the script to say whatever it is that you want to help keep yourself organized:

echo "Spam Assassin was started successfully!"
 
Old 06-14-2012, 05:35 PM   #17
OldDad
LQ Newbie
 
Registered: Jun 2012
Posts: 12

Original Poster
Rep: Reputation: Disabled
Added the line to .bashrc and that worked, thanks!!!

Jay
 
Old 06-14-2012, 05:38 PM   #18
OldDad
LQ Newbie
 
Registered: Jun 2012
Posts: 12

Original Poster
Rep: Reputation: Disabled
>> echo "Spam Assassin was started successfully!"

That line is already in the wrapper script. But what is happening is that the email is being sent regardless if spamd is running or not running. Any way to send an email if spamd actually failed, not running and then restarted?

Jay
 
Old 06-14-2012, 05:42 PM   #19
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604

Rep: Reputation: 415Reputation: 415Reputation: 415Reputation: 415Reputation: 415
The script should not be sending anything unless spam assassin is not running and is started. So if you look at the script it first uses ps to find the total number of spamd process running. If that number is greater than 0 it exits the script without sending you an email. If it is equal to 0 it starts spam assasin, verifys that it started successfully with the RET variable and will send you an email letting you know whether spam assassin started up correctly.

You could change that last echo line to say "Spam Assassin was not running! Spam assassin was started successfully."
 
Old 06-14-2012, 05:44 PM   #20
OldDad
LQ Newbie
 
Registered: Jun 2012
Posts: 12

Original Poster
Rep: Reputation: Disabled
Hmmm, we may be up the proverbial creek here. I'm looking at "top" and notice that spamd runs and then disappears from user "root" and "nobody" which tells me that spamd only runs when an email is coming in. Does that sound reasonable? If that is the case then I may have to run this script every hour so my mailbox doesn't overflow. My hundreds of email clients will just have to put up with "spam" until it's restarted should it fail. :-)

Jay
 
Old 06-14-2012, 05:53 PM   #21
Kustom42
Senior Member
 
Registered: Mar 2012
Distribution: Red Hat
Posts: 1,604

Rep: Reputation: 415Reputation: 415Reputation: 415Reputation: 415Reputation: 415
I don't really like spam assassin in all honesty but I thought it ran all the time not only when new mail came in. I know that it spawns a child process when new mail comes in to check it but there should be a daemon or parent process running that sees the new mail and spawns it.

With some control panels the process name may be different than spamd, it's possible that your hosting company can answer that question but you may need to use ps to figure it out.

first get a pid of a running spamd process

Code:
ps aux | grep spamd
Then get the parent process ID of it:

Code:
ps -F -pinsert process id here| cut -d" " -f7
Then

Code:
ps -f -pinsert parent process id here
 
1 members found this post helpful.
Old 06-14-2012, 06:01 PM   #22
OldDad
LQ Newbie
 
Registered: Jun 2012
Posts: 12

Original Poster
Rep: Reputation: Disabled
I may just run the script every 2 hours, spamd sometimes only fails twice daily. Running the code you posted shows a different pid almost every time it's run. Verio is no help at all and that changed the first of this year. I've been with them for a very long time starting with a VPS-1. Their support was impeccable, helpful and very knowledgeable, even had one of the guys and his wife visit with us one Mardi Gras. Not so any longer, those days are long gone. Thanks for all your help.

Cheers, Jay
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] cron doesn't start a script alex64 Linux - Newbie 9 06-11-2011 12:27 AM
using cron to start and stop a bash script monty Linux - Software 2 03-20-2006 02:30 PM
shell script fo run auto job in cron JolynnMarie LinuxQuestions.org Member Intro 0 04-28-2004 11:21 AM
Auto Start Script for Oracle sikandar Linux - Software 0 09-12-2003 10:43 PM
KDE auto start script problem Coolrunr Programming 2 09-08-2003 09:55 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 05:30 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration