Kevin Anderson said:
>> Now just directing everything to /dev/null might not be Kevin's best
>
> This is my best option.
>
> The mail package has a logging facility.  This cronjob just tries to
> restart a delivery queue, so that IF, for some reason, a message isn't
> delivered, it'll retry again a few minutes later.  Each try will be
> logged by the mail logger as well.  I'm not ignoring the logs.
>
> The error is a result of me starting a process that is already running,
> and cannot be ran multiple times simultaneously.  So I get errors saying
> essentially "What are you thinking, moron, this is already running,
> there's nothing in the queue, leave me alone..."
>
> A similar situation may result if I was to add a cron job so calling
> httpd every 5 minutes, in case httpd stops for some reason.  There will
> still be a log in /var/log/httpd, but cron will also tell me that this
> is already running, I'm an idiot for calling this over and over.
>

You could also have your script check first if the processes are running
and only try to restart them if they aren't.... that would solve the
errors when it tries to start an already running service.  Or if the
process listens on a certain port and doesn't actually die when the
service is interupted you could check to see if the port is accepting
connections (ie smtp, http) by checking the port using nmap in your
script.  Depending on what nmap finds it could restart it for you and
email you or do nothing at all.

Cheers,

Trevor


Reply via email to