<div dir="ltr">Hi,<div><br></div><div style>I have daemon on Linux Mint 14 64bit which working fine, but I noticed that OnStop and OnDestroy events are never fired. I created simple test which write to syslog and create file in my home directory:</div>
<div style><br></div><div style><div>procedure TTestDaemon.DataModuleStop(Sender: TCustomDaemon; var OK: Boolean);</div><div>var sl: TStringList;</div><div>begin</div><div> sl := TStringList.Create;</div><div> try</div>
<div> sl.Add('test');</div><div> sl.SaveToFile('/home/dibo/s.txt');</div><div> finally</div><div> sl.Free;</div><div> end;</div><div> Application.Log(etInfo, 'Stopping');</div><div>end; </div>
<div><br></div><div><div>procedure TTestDaemon.DataModuleDestroy(Sender: TObject);</div><div>var sl: TStringList;</div><div>begin</div><div> sl := TStringList.Create;</div><div> try</div><div> sl.Add('test');</div>
<div> sl.SaveToFile('/home/dibo/d.txt');</div><div> finally</div><div> sl.Free;</div><div> end;</div><div> Application.Log(etInfo, 'destroying');</div><div>end;</div></div><div><br></div><div style>
But these event doesn't add logs in syslog, text file in home directory isn't created also. Is linux blocking disk writting when stopping service?</div><div style>There is also OnShutDown event which is working fine (I finally moved my "clean" methods to this event) but I'm wondering why mentioned events are not fired?</div>
<div style><br></div><div style>Regards</div></div></div>