Rony

This is a known problem.  I've brought it up before.  The problem is that Mac OS X daemons that are controlled by launchd, are not allowed to daemonize themselves.  Since the current rxapi daemonizes a child process, and then exits, launchd looses all communication/control of the child process.  Launchd thinks that the daemon has failed and tries to restart it, which then fails because of the PID file.  I coded up a work around similar to the work around that was put in place for AIX.  I was told not to mess with rxapi, that someone would rewrite it later.

Bruce
On Feb 20, 2011, at 6:19 AM, Rony G. Flatscher wrote:

Hi there,

while looking at the Console's log entries ("Application - Console") it seems that launchd tries restarting the rxapi daemon in 10 second intervals. Is this intentional or a potential problem?

This is how the rxapi-daemon gets started (copied from Bruce's script):
launchctl load -w /Library/LaunchDaemons/org.rexxla.oorexx.rxapid.plist
  
with the content:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>Disabled</key>
	<false/>
	<key>KeepAlive</key>
	<true/>
	<key>Label</key>
	<string>org.rexxla.oorexx.rxapid</string>
	<key>ProgramArguments</key>
	<array>
		<string>/usr/bin/rxapi</string>
	</array>
	<key>RunAtLoad</key>
	<true/>
</dict>
</plist>
  

Here's a sample of log-entries (after a fresh reboot to test whether the launchd is indeed processing the rxapi daemon)::
Feb 20 15:09:44 ronymac com.apple.launchd.peruser.501[173] (filled during runtime[331]): posix_spawn("filled during runtime", ...): No such file or directory
Feb 20 15:09:44 ronymac com.apple.launchd.peruser.501[173] (de.novamedia.NMDeviceObserver[330]): Exited with exit code: 1
Feb 20 15:09:44 ronymac com.apple.launchd.peruser.501[173] (de.novamedia.NMDeviceObserver): Throttling respawn: Will start in 10 seconds
Feb 20 15:09:44 ronymac com.apple.launchd.peruser.501[173] (filled during runtime[331]): Exited with exit code: 1
Feb 20 15:09:44 ronymac com.apple.launchd.peruser.501[173] (filled during runtime): Throttling respawn: Will start in 10 seconds
Feb 20 15:09:44 ronymac org.rexxla.oorexx.rxapid[332]: Error: There is already a server running.
Feb 20 15:09:44 ronymac org.rexxla.oorexx.rxapid[332]:        Aborting execution.
Feb 20 15:09:44 ronymac com.apple.launchd[1] (org.rexxla.oorexx.rxapid[332]): Exited with exit code: 255
Feb 20 15:09:44 ronymac com.apple.launchd[1] (org.rexxla.oorexx.rxapid): Throttling respawn: Will start in 10 seconds

Feb 20 15:09:54 ronymac com.apple.launchd.peruser.501[173] (de.novamedia.NMDeviceObserver[333]): posix_spawn("/Applications/web'n'walk Manager/web'n'walk Manager.app/Contents/MacOS/NMDeviceObserver.app/Contents/MacOS/NMDeviceObserver", ...): No such file or directory
Feb 20 15:09:54 ronymac com.apple.launchd.peruser.501[173] (filled during runtime[334]): posix_spawn("filled during runtime", ...): No such file or directory
Feb 20 15:09:54 ronymac com.apple.launchd.peruser.501[173] (de.novamedia.NMDeviceObserver[333]): Exited with exit code: 1
Feb 20 15:09:54 ronymac com.apple.launchd.peruser.501[173] (de.novamedia.NMDeviceObserver): Throttling respawn: Will start in 10 seconds
Feb 20 15:09:54 ronymac com.apple.launchd.peruser.501[173] (filled during runtime[334]): Exited with exit code: 1
Feb 20 15:09:54 ronymac com.apple.launchd.peruser.501[173] (filled during runtime): Throttling respawn: Will start in 10 seconds
Feb 20 15:09:54 ronymac org.rexxla.oorexx.rxapid[335]: Error: There is already a server running.
Feb 20 15:09:54 ronymac org.rexxla.oorexx.rxapid[335]:        Aborting execution.
Feb 20 15:09:54 ronymac com.apple.launchd[1] (org.rexxla.oorexx.rxapid[335]): Exited with exit code: 255
Feb 20 15:09:54 ronymac com.apple.launchd[1] (org.rexxla.oorexx.rxapid): Throttling respawn: Will start in 10 seconds

Feb 20 15:10:04 ronymac com.apple.launchd.peruser.501[173] (de.novamedia.NMDeviceObserver[336]): posix_spawn("/Applications/web'n'walk Manager/web'n'walk Manager.app/Contents/MacOS/NMDeviceObserver.app/Contents/MacOS/NMDeviceObserver", ...): No such file or directory
Feb 20 15:10:04 ronymac com.apple.launchd.peruser.501[173] (filled during runtime[337]): posix_spawn("filled during runtime", ...): No such file or directory
Feb 20 15:10:04 ronymac com.apple.launchd.peruser.501[173] (de.novamedia.NMDeviceObserver[336]): Exited with exit code: 1
Feb 20 15:10:04 ronymac com.apple.launchd.peruser.501[173] (de.novamedia.NMDeviceObserver): Throttling respawn: Will start in 10 seconds
Feb 20 15:10:04 ronymac com.apple.launchd.peruser.501[173] (filled during runtime[337]): Exited with exit code: 1
Feb 20 15:10:04 ronymac com.apple.launchd.peruser.501[173] (filled during runtime): Throttling respawn: Will start in 10 seconds
Feb 20 15:10:04 ronymac org.rexxla.oorexx.rxapid[338]: Error: There is already a server running.
Feb 20 15:10:04 ronymac org.rexxla.oorexx.rxapid[338]:        Aborting execution.
Feb 20 15:10:04 ronymac com.apple.launchd[1] (org.rexxla.oorexx.rxapid[338]): Exited with exit code: 255
Feb 20 15:10:04 ronymac com.apple.launchd[1] (org.rexxla.oorexx.rxapid): Throttling respawn: Will start in 10 seconds
.... 
  
There is at least another daemon that gets restarted, other daemons do not get restarted, which is the reason for querying whether the observed behaviour is o.k. or not.

---rony

------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb_______________________________________________
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel