'launchctl remove' synchronicity
Hello list, It seems "launchctl remove" and "launchctl unload" do not behave in the same way when unregistering a job from launchd. I can reload a job by doing "launchctl unload" / "launchctl load" and it works fine. However doing "launchctl remove" / "SMJobSubmit" makes launchd complain about "Conflict with job: job_label over Mach service: service_name". It seems that when SMJobSubmit is called and tries to load the job, the Mach services of the previous instance of the job are still registered into launchd. Adding a delay between "launchctl remove" and "SMJobSubmit" seems to solve the issue. Is this to be expected? Thomas
On 2012 May 04, at 01:19, Thomas Clement wrote:
It seems that when SMJobSubmit is called and tries to load the job, the Mach services of the previous instance of the job are still registered into launchd. Adding a delay between "launchctl remove" and "SMJobSubmit" seems to solve the issue.
Is this to be expected?
I don't know. I reported a similar bug last year, not involving SMJobSubmit but involving launchctl load. I just noticed that Apple has since closed my bug, marking it as a duplicate of 10111533. I think that means that I will never receive any information about the bug's status. If anyone on the inside could tell us the state of bug 10111533, that would probably be helpful to both Thomas, myself, and others who have been scratching our heads over apparent race conditions in launchd. Thanks, Jerry Krinock
On 4 May 2012, at 17:31, Jerry Krinock wrote:
If anyone on the inside could tell us the state of bug 10111533, that would probably be helpful to both Thomas, myself, and others who have been scratching our heads over apparent race conditions in launchd.
This bug is marked as resolved in Mountain Lion 12A165 and later. Please try out your tests on the current Mountain Lion seed and file a new bug if you still have problems. <http://developer.apple.com/bugreporter/> IMPORTANT: As this is a public mailing list we can't talk about Mountain Lion specifics here. If you have Mountain Lion questions or comments, you can post them to DevForums. <https://devforums.apple.com/community/mac/pre/coreos/unix> However, if the comment is "this is still a problem", then a fresh bug report is your best bet. Share and Enjoy -- Quinn "The Eskimo!" <http://www.apple.com/developer/> Apple Developer Relations, Developer Technical Support, Core OS/Hardware
participants (3)
-
Jerry Krinock
-
Quinn "The Eskimo!"
-
Thomas Clement