<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<br>
<br>
Joost van der Sluis wrote:
<blockquote cite="mid:1257772255.8317.18.camel@wsjoost.cnoc.lan"
type="cite">
<pre wrap="">On Mon, 2009-11-09 at 13:02 +0200, Wimpie Nortje wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Michael Van Canneyt wrote:
</pre>
<blockquote type="cite">
<pre wrap="">It should stop the daemons properly. This is the code that gets executed:
Procedure DoShutDown(Sig : Longint; Info : PSigInfo; Context :
PSigContext);
cdecl;
begin
Application.StopDaemons(True);
Application.Terminate;
end;
If it doesn't, something is wrong :(
</pre>
</blockquote>
<pre wrap="">I think something is wrong. :(
For my TDaemon descendant I assigned the following events:
OnDestroy
OnExecute
OnPause
OnShutdown
OnStart
OnStop
When I type "./daemon -r &"
The following handlers are executed:
1. OnStart
2. OnExecute
When I type "kill -TERM daemon_pid"
The following handler is executed
1. OnDestroy
I am also a bit confused by the wiki. According to the wiki Start and
stop are triggered under linux but shutdown is not. The 'Taming the
daemon' article does not specify which of these 3 are called under linux.
As I mentioned earlier, I use FPC 2.2.4. Could that be the problem?
</pre>
</blockquote>
<pre wrap=""><!---->
I don't know how I did it exactly, but I ahve this working properly in a
production system. (Even created my own SysV init script for it. It
should be generally usable for all fpc-daemon applications)
But I did use fpc 2.3.1, so try the new 2.4.0rc1. And I think that it
won't work always now I've read Jonas' mail about it. Maybe I'll look at
that later.
</pre>
</blockquote>
Thanks, I will try the new compiler.
</body>
</html>