[squid-users] The email notification feature does not work after 10 days

Amos Jeffries squid3 at treenet.co.nz
Sat Jan 31 10:04:50 UTC 2015


On 31/01/2015 6:41 p.m., Tianyin Xu wrote:
> Hi,
> 
> I'm trying to use the email notification feature specified in the document.
> http://www.squid-cache.org/Doc/config/mail_program/
> http://www.squid-cache.org/Doc/config/cache_mgr/
> http://www.squid-cache.org/Doc/config/mail_from/
> 
> Basically, if the Squid proxy server dies, I can receive an email
> notification by configuring "mail_program", "cache_mgr", and
> "mail_from". This is a very nice feature.
> 
> However, when I start Squid and then intentionally kill Squid by
> issuing SEGV, Squid dies without sending any email to me. Diving into
> the code, I see that the email notification feature is disabled by the
> following if condition,
> 
>     /* src/tools.cc */
>     ....
>     if (squid_curtime - SQUID_RELEASE_TIME < 864000) {
>         /* skip if more than 10 days old */
>         if (Config.adminEmail)
>             mail_warranty();
> 
>         puts(dead_msg());
>     }
> 
> From the comment, it seems that intentionally the feature is disabled
> if the current time is latter than 10 days after the release time
> (which is my case). This totally makes no sense to me because most
> users like me will use this feature after 10 days latter than the
> release date...
> 
> Could anyone explain this? I moved the if-condition and the feature does work.
> 
> I also opened a bugzilla report here,
> http://bugs.squid-cache.org/show_bug.cgi?id=4184


It is a difficult situation.

The 10 day limit is itself a feature designed to reduce spam emails
being delivered from production systems which are stuck long-term on
"stable" version packages. Often long after the crash being notified
about is found and fixed. There are people still running Squid 3.1.6 for
example, despite years having passed and numerous crashes having been fixed.

Squid auto-restarts after crashes to ensure minimal downtime and user
impact. There are also numerous other things that could happen that are
only ever logged - that includes the reason for the crash being
notified.  So you should have log monitoring in place for production
systems anyway which mails you on criteria you are interested in. Making
this feature much less interesting for production systems using the
formal release for long periods of time.


It is much more interesting / useful to hear about crashes in newer code
with less production use and testing behind it.

The development code and daily snapshots define SQUID_RELEASE_TIME to be
squid_curtime so the if-condition always matches and enables the feature
for experimental installations.

This combined with the fact that the only way to resolve crash
conditions is to patch the code and/or build latest release snapshot,
means that people who are actually interested in avoiding those type of
problem are usually running the snapshot code where the 10-day limit
does not apply.


Amos


More information about the squid-users mailing list