LaunchD crashing daemon in 10.5
I have an agent and daemon that I have installed and running on a 10.5 system. The problem I am having is when I do an 'update' the call from 'sudo launchctl unload /System/Library/LaunchDaemons/com.mycompany.mydaemon.com' my daemon receives a SIGTERM and aborts and the rest of my install procedures fails. My project consists of an agent and a daemon. The plists that I use 'launchctl unload' on live in the following areas: Daemon = /System/Library/LaunchDaemons/ Agent = /Library/LaunchAgents/ I use 'sudo launchctl unload ...' for the daemon and 'launchctl unload ...' for the agent. This 'update' works fine in 10.4 but fails under 10.5. I can install my agent and daemon fine I just can't seem to 'unload' gracefully running in the 10.5 enviroment. Any suggestions or help would greatly be appreciated. Carl
Not that this should be causing the problem, but you shouldn't be writing to /System -- your daemon should be installed in /Library/LaunchDaemons. Can you not just catch SIGTERM in your daemon and exit cleanly? Hamish On Feb 8, 2008 11:45 PM, Carl Smith <Carl.Smith@kaseya.com> wrote:
I have an agent and daemon that I have installed and running on a 10.5 system. The problem I am having is when I do an 'update' the call from 'sudo launchctl unload /System/Library/LaunchDaemons/com.mycompany.mydaemon.com' my daemon receives a SIGTERM and aborts and the rest of my install procedures fails.
My project consists of an agent and a daemon. The plists that I use 'launchctl unload' on live in the following areas:
Daemon = /System/Library/LaunchDaemons/ Agent = /Library/LaunchAgents/
I use 'sudo launchctl unload ...' for the daemon and 'launchctl unload ...' for the agent.
This 'update' works fine in 10.4 but fails under 10.5. I can install my agent and daemon fine I just can't seem to 'unload' gracefully running in the 10.5 enviroment.
Any suggestions or help would greatly be appreciated.
Carl _______________________________________________ launchd-dev mailing list launchd-dev@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo/launchd-dev
I am taking over this project from another developer so please excuse me ahead of time for any 'stupid' questions. As far as SIGTERM goes in Apples tech notes about launchd it says one should be catching SIGTERM, for what I do not know, but my question would be why would catching it in 10.4 not make a different but in 10.5 it does? And why would 10.5 be throwing a SIGTERM and 10.4 not throwing one? Thanks Carl Not that this should be causing the problem, but you shouldn't be writing to /System -- your daemon should be installed in /Library/LaunchDaemons. Can you not just catch SIGTERM in your daemon and exit cleanly? Hamish On Feb 8, 2008 11:45 PM, Carl Smith <Carl.Smith@kaseya.com> wrote:
I have an agent and daemon that I have installed and running on a 10.5 system. The problem I am having is when I do an 'update' the call from 'sudo launchctl unload /System/Library/LaunchDaemons/com.mycompany.mydaemon.com' my daemon receives a SIGTERM and aborts and the rest of my install procedures fails.
My project consists of an agent and a daemon. The plists that I use 'launchctl unload' on live in the following areas:
Daemon = /System/Library/LaunchDaemons/ Agent = /Library/LaunchAgents/
I use 'sudo launchctl unload ...' for the daemon and 'launchctl unload ...' for the agent.
This 'update' works fine in 10.4 but fails under 10.5. I can install my agent and daemon fine I just can't seem to 'unload' gracefully running in the 10.5 enviroment.
Any suggestions or help would greatly be appreciated.
Carl _______________________________________________ launchd-dev mailing list launchd-dev@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo/launchd-dev
_______________________________________________ launchd-dev mailing list launchd-dev@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo/launchd-dev
On Feb 9, 2008 12:07 AM, Carl Smith <Carl.Smith@kaseya.com> wrote:
And why would 10.5 be throwing a SIGTERM and 10.4 not throwing one?
I'm not sure, but there have been many enhancements to launchd between 10.4 and 10.5. SIGTERM is the appropriate signal for asking a POSIX process to terminate gracefully -- indeed, how did the daemon ever manage to exit gracefully under 10.4? Also, why does the rest of your installation procedure fail when your daemon exits abruptly? Hamish
On Feb 8, 2008, at 3:45 PM, Carl Smith wrote:
I have an agent and daemon that I have installed and running on a 10.5 system. The problem I am having is when I do an 'update' the call from 'sudo launchctl unload /System/Library/LaunchDaemons/com.mycompany.mydaemon.com' my daemon receives a SIGTERM and aborts and the rest of my install procedures fails.
My project consists of an agent and a daemon. The plists that I use 'launchctl unload' on live in the following areas:
Daemon = /System/Library/LaunchDaemons/ Agent = /Library/LaunchAgents/
I use 'sudo launchctl unload ...' for the daemon and 'launchctl unload ...' for the agent.
This 'update' works fine in 10.4 but fails under 10.5. I can install my agent and daemon fine I just can't seem to 'unload' gracefully running in the 10.5 enviroment.
Any suggestions or help would greatly be appreciated.
Your daemon is not following the spec. It must catch SIGTERM, cleanup, then exit(EX_OK). -- Shaun Wexler MacFOH http://www.macfoh.com "A person who never made a mistake never tried anything new." - Albert Einstein
participants (4)
-
Carl Smith
-
Hamish Allan
-
Joseph Jacobs
-
Shaun Wexler