launchd console application problem

Hi guys, I’m building a console application and setting up OS X’s launchd to keep the application running. The console app is being built with Real Studio 2011 R4.3. When I load the plist into launchd, the console application is launched, but every interval, launchd starts another instance of the application. At one point there were over 400 instances running on my machine. I checked the console log, and it says:

The only thing comparable I’ve been able to find online was someone was trying to start Apache by using “apachectl”, which launched “apached”, and when launchd checked, it saw that “apachectl” was no longer running, and launched it again.

I’m hoping RS is doing something similar behind the scenes. Ideas? if necessary, I can try compiling the console app with Real Studio 2012 R2.1 or Xojo 2013 R3.2

If you have a service application and want to work with launchd, you have to return True from your DontDaemonize event handler.

Thanks, I’ll try converting it to a ServerApplication. I hadn’t done that because it doesn’t need to run when a user isn’t logged in. And I guess I should remove the App.Demonize call I have in the Run event.

The call to App.Daemonize is your entire problem. Remove it and everything should just work.

Thanks Joe! That did it!