<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">Hi Folks,<div><br></div><div>We recently deployed amavis in a scenario where we are reloading the daemon every 5 minutes due to updated preferences read using read_hash. We have encountered about 5 times this fortnight that the daemon failed to restart.</div><div><br></div><div>I have tracked this down to a stale __db.nanny.db file in the /var/lib/amavis/db directory. I checked into the daemon with strace and I can see that during startup first __db.nanny.db is created, then renamed to nanny.db. I haven’t been able to reproduce the situation on demand but I imagine that basically it restarts, __db.nanny.db is created but then the rename fails and the daemon exits and gets stuck in this state. More investigation needed here but likely something like a connection is still in progress and happens to write nanny.db or some such.</div><div><br></div><div><div>The db cleanup on start only cleans up nanny.db and not __db.nanny.db and thus it never starts, which leaves it in a broken state.</div></div><div><br></div><div><br></div><div>I have also found numerous mailing list posts of other people experiencing the same issue (and the same fix of rm /var/lib/amavis/db/*)</div><div><br></div><div><br></div><div><br></div><div><br></div><div>Attached patch will clean up both files on restart, we could optionally apply the same regex to snmp.db but I have not yet seen that issue in production so have not done that for now.</div><div>It’s also not clear to me which database __db.NNN applies to, and if that check should change to be || instead of &&.. I tried to find docs on this in bdb but was failing, hoping this patch will do the job for now :)</div><div><br></div><div><br></div><div>Patch attached, also at: <a href="https://github.com/lathiat/amavisd/commit/ab06ff2ad009a687ae86fd35964286682a3d1a5d">https://github.com/lathiat/amavisd/commit/ab06ff2ad009a687ae86fd35964286682a3d1a5d</a></div><div><br></div><div>Thanks,<br><div>
<div style="color: rgb(0, 0, 0); font-style: normal; font-variant: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-family: Calibri, sans-serif; font-size: 15px; "><p class="MsoNormal" style="font-weight: normal; margin: 0cm 0cm 12pt; font-size: 11pt; "></p><div><p class="MsoNormal" style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 11pt; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; margin: 0cm 0cm 12pt; "><b><span style="font-size: 10pt; color: rgb(64, 64, 64); ">Trent Lloyd</span></b></p><span style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 15px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><span><br class="Apple-interchange-newline"><span></span></span></span></div></div></div></div></body></html>