[Dovecot] Re: Dovecot died due to some SSL related error

rhr-dovecot at batky-howell.com rhr-dovecot at batky-howell.com
Fri Apr 9 00:33:05 EEST 2004


  Following up to myself - per an email request from a new subscriber,
here's my script and crontab entry for checking and restarting dovecot on
Redhat/Fedora.  This catches a crashed dovecot at least once a day,
sometimes several, all due to the "PRNG not seeded" thing on Fedora.

  I could have just let the cron daemon email the results to root like
any other cron job, but I wanted a copy to my own account.
Running on a couple of hosts - MYHOST replaced with actual hostname,
MY-PERSONAL at EMAIL.ADDR replaced with ... well you get the picture.

Hope it's useful,
Rob

root Crontab:
=============================================================================
## Run once every minute, always.
* * * * * /root/CronJobs/cron.chk_dovecot >/dev/null 2>&1
=============================================================================

Script: /root/CronJobs/cron.chk_dovecot
=============================================================================
#!/bin/bash
                                                                                
if ! pgrep -x dovecot
then
  if [ -f /var/lock/subsys/dovecot ]; then
    if rm -f /var/lock/subsys/dovecot ; then
      MsgRmLock="Lock file /var/lock/subsys/dovecot removed."
    else
      MsgRmLock="Unable to remove lock file /var/lock/subsys/dovecot."
    fi
  else
    MsgRmLock="No lock file found: /var/lock/subsys/dovecot."
  fi
                                                                                
  if /etc/init.d/dovecot start; then
    MsgStart="Dovecot started."
  else
    MsgStart="Unable to start Dovecot."
  fi
                                                                                
  if pgrep -x dovecot; then
    MsgRunning="Dovecot running."
  else
    MsgRunning="Dovecot not running. To restart, run (as root):
    /etc/init.d/dovecot start"
  fi
                                                                                
  mail -s "MYHOST DOVECOT NOT RUNNING `date '+%R %D'`" -c root MY-PERSONAL at EMAIL.ADDR  <<EoMaIl
                                                                                
  On MYHOST, the command "pgrep -x dovecot" returned false, indicating
that dovecot is not running.
                                                                                
  Restart attempted.  Results:
  $MsgRmLock
  $MsgStart
  $MsgRunning
                                                                                
EoMaIl
                                                                                
fi
=============================================================================

In a message sent Fri Mar 19 13:16:52 2004, rhr-dovecot at batky-howell.com wrote:
> (Sorry, just joined the list, can't reply in the original message
> from Feb 4.)
> > Feb  4 11:18:27 hundehuette imap-login: RAND_bytes() failed:
> > error:24064064:random number generator:SSLEAY_RAND_BYTES:PRNG not
> > seeded
> > Feb  4 11:18:27 hundehuette dovecot: Login process died too early -
> > shutting down
> > [...]
> 
> Hi,
> 
>   No idea, but I'm getting the same thing, at least once a day,
> sometimes several times a day.  I tried putting a .rnd file in
> /var/libexec/dovecot, no help.
> 
> - Fedora Core 1.0
> - dovecot-0.99.10-6
> - openssl-0.9.7a-23
> - About 20 users, using pop, pops, imap, imaps.
> 
>   I had to run a cron job that checks every minute to see if dovecot
> is running, and restart it if it isn't.  I'd love to get this figured
> out, though.  I see another message about this in the list archives,
> at the end of January.  I'll post if I find anything...
> 
> Rob


More information about the dovecot mailing list