watchdog implementation on S60 3rd

Login to reply to this topic.
Tue, 2006-11-14 20:50
Joined: 2006-08-13
Forum posts: 44
I am trying to implement a watchdog process that will re launch the main process if it crashes.
I am creating the watchdog from the main process using this code:

   RProcess server;
   server.Create(_L("c:\\sys\\bin\\watchdog.exe"), _L(""));
   
   CApaCommandLine* commandLine = CApaCommandLine::NewL();
   commandLine->SetExecutableNameL(_L("c:\\sys\\bin\\watchdog.exe"));
   commandLine->SetProcessEnvironmentL(server);
   RApaLsSession ApaSession;
   ApaSession.Connect();
   ApaSession.StartApp(*commandLine);
   ApaSession.Close();

the problem is that when the main process crashes, the watchdog process goes down with it, rendering it useless as a watchdog.

any ideas ?

Fri, 2006-11-17 16:05
Joined: 2004-11-29
Forum posts: 1233
Re: watchdog implementation on S60 3rd
Create your main process from the watchdog process instead?

seems simpler to implement too, no need to find the main process from the watchdog, since it will already have a handle to it.
  • Login to reply to this topic.