<div>Hi, </div>
<div>&nbsp;</div>
<div>I wanted to do some cleanup activities during the time of server shutdown. Couldn't find any particular event that is sent at that time. But looking at: zope.app.main.main, i tried: </div>
<div>&nbsp;</div>
<div>from twisted.internet import reactor</div>
<div>&nbsp;</div>
<div>def shutdown():</div>
<div>&nbsp; #shutdown code here.</div>
<div>&nbsp;&nbsp; pass</div>
<div>&nbsp;</div>
<div>reactor.addSystemEventTrigger('before',<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'shutdown', shutdown)</div>
<div>&nbsp;</div>
<div>and this seems to work. (did this under an event handler for DatabaseOpenedWithRootEvent). </div>
<div>&nbsp;</div>
<div>Just want to confirm, is it the right way to do, or there is some better way to do things? </div>
<div>&nbsp;</div>
<div>With regards,</div>
<div>-Shailesh</div>
<div>&nbsp;</div>