Karl O. Pinc wrote:
> On 04/21/2009 08:23:29 AM, Jeff Grossman wrote:
>> My Sqlgrey daemon died last night and all of my mail was temp failed.
>>
>> What do people recommend for making sure the daemon stays running?
>
> I had a problem like this until I upgraded to the latest
> version available, which IIRC is a beta but I think only
> because nobody's gotten around to releasing it.
>
> If that does not fix it you're probably better off
> solving the problem at it's source rather than papering
> over the symptom.
Easier said than done. I have sqlgrey die intermittently (like, 1 or 2
times per year) with an obscure internals error. I know my perl
internals pretty well but I have only a vague idea where to start
looking. A better use of my time was to write a watchdog.
Here's my version (relies on FreeBSD's sockstat):
#! /usr/local/bin/perl -w
my $alive = 0 + `/usr/bin/sockstat -l|/usr/bin/grep
127.0.0.1:2501|/usr/bin/wc -l`;
exit if $alive;
system( "/usr/local/etc/rc.d/sqlgrey restart" );
system( qq{mail -s 'sqlgrey restarted' david < /dev/null } );
__END__
Hmm, that should probably have been written in shell, come to think of it :)
David
|