I altered the code of zmcontrol to log a line like "Checking status FOR ERROR-STATUS" when entering the function doStatus.
What I found out is that the error condition occurs in a timeout situation. Should a timeout occur, a log entry is created "zmstatuslog timeout after 60 seconds" and the script terminates. At this time, the file does not get closed.
See part of my log when the error occured (BTW: The file not being deleted has a time stamp of 05:51 hrs): May 10 05:50:14 mail zimbramon[6482]: 6482:info: Checking status FOR ERROR-STATUS
May 10 05:50:16 mail amavis[20979]: (20979-04) Blocked SPAM, [xxx.xx.xxx.xx] [xxx.xx.xxx.xx] <xxxxxxxxxxxx@xxxxxxxx.com> -> <xxxxxx@xxxxxx.xx>, Message-ID: <xxxxxxxxxxxxxxxxxxxxxxxxxx@xxxxxxxxxxxx>, mail_id: bwUKmDjLXK-7, Hits: 25.608, size: 7591, 7228 ms
May 10 05:50:16 mail postfix/smtp[6635]: 6CAC6AFF95: to=<xxx@xxx.com>, relay=127.0.0.1[127.0.0.1]:10024, delay=11, delays=4.1/0.03/0.03/7.2, dsn=2.7.0, status=sent (250 2.7.0 Ok, discarded, id=20979-04 - SPAM)
May 10 05:50:16 mail postfix/qmgr[6212]: 6CAC6AFF95: removed
May 10 05:50:30 mail postfix/smtpd[6054]: connect from yyy.com[xx.x.x.xx]
May 10 05:50:38 mail CRON[6450]: (pam_unix) session closed for user zimbra
May 10 05:50:38 mail postfix/smtpd[6054]: NOQUEUE: reject: RCPT from yyy.com[xx.x.x.xx]: 550 5.1.1 <xxx@xxx.com>: Recipient address rejected: xxx.com; from=<zzz@zzz.com> to=<xxx@xxx.com> proto=ESMTP helo=<yyy.com>
May 10 05:50:40 mail postfix/smtpd[6054]: lost connection after DATA from yyy.com[xx.x.x.xx]
May 10 05:50:40 mail postfix/smtpd[6054]: disconnect from yyy.com[xx.x.x.xx] May 10 05:50:47 mail zmmailboxdmgr[6763]: status requested
May 10 05:50:47 mail zmmailboxdmgr[6763]: status OK May 10 05:50:58 mail clamd[5520]: Database correctly reloaded (450460 signatures) May 10 05:51:01 mail zimbramon[6456]: 6456:info: zmstatuslog timeout after 60 seconds
May 10 05:51:03 mail postfix/smtpd[6054]: connect from yyy.com[xx.x.x.xx]
May 10 05:51:05 mail CRON[6455]: (pam_unix) session closed for user zimbra
May 10 05:51:06 mail postfix/smtpd[6054]: NOQUEUE: reject: RCPT from yyy.com[xx.x.x.xx]: 550 5.1.1 <xxxm@xxx.com>: Recipient address rejected: xxx.com; from=<uuu@uuu.com> to=<xxxm@xxx.com> proto=ESMTP helo=<yyy.com>
May 10 05:51:09 mail postfix/smtpd[6054]: lost connection after DATA from yyy.com[xx.x.x.xx]
May 10 05:51:09 mail postfix/smtpd[6054]: disconnect from yyy.com[xx.x.x.xx]
May 10 05:52:01 mail CRON[7036]: (pam_unix) session opened for user zimbra by (uid=0) May 10 05:52:06 mail zimbramon[7046]: 7046:info: Checking status FOR ERROR-STATUS
May 10 05:52:08 mail zmmailboxdmgr[7174]: status requested
May 10 05:52:08 mail zmmailboxdmgr[7174]: status OK
May 10 05:52:11 mail zimbramon[7037]: 7037:info: 2008-05-10 05:52:02, STATUS: mail.xxx.com: antispam: Running
May 10 05:52:11 mail zimbramon[7037]: 7037:info: 2008-05-10 05:52:02, STATUS: mail.xxx.com: antivirus: Running
May 10 05:52:11 mail zimbramon[7037]: 7037:info: 2008-05-10 05:52:02, STATUS: mail.xxx.com: ldap: Running
May 10 05:52:11 mail zimbramon[7037]: 7037:info: 2008-05-10 05:52:02, STATUS: mail.xxx.com: logger: Running
May 10 05:52:11 mail zimbramon[7037]: 7037:info: 2008-05-10 05:52:02, STATUS: mail.xxx.com: mailbox: Running
May 10 05:52:11 mail zimbramon[7037]: 7037:info: 2008-05-10 05:52:02, STATUS: mail.xxx.com: mta: Running
May 10 05:52:11 mail zimbramon[7037]: 7037:info: 2008-05-10 05:52:02, STATUS: mail.xxx.com: snmp: Running
May 10 05:52:11 mail zimbramon[7037]: 7037:info: 2008-05-10 05:52:02, STATUS: mail.xxx.com: spell: Running
May 10 05:52:11 mail zimbramon[7037]: 7037:info: 2008-05-10 05:52:02, STATUS: mail.xxx.com: stats: Running
May 10 05:52:11 mail CRON[7036]: (pam_unix) session closed for user zimbra
The file zmcontrol has defined a line $SIG{ALRM} = sub { print "Timeout after $timeout seconds\n"; exit(1) };
The files should be unlinked before exit(1) is called.
Last edited by mfehr : 05-10-2008 at 02:17 PM.
|