Re: Launchd daemon
Re: Launchd daemon
- Subject: Re: Launchd daemon
- From: Erwin Namal <email@hidden>
- Date: Mon, 18 Mar 2013 16:36:48 +0100
Basically, structure it the same wait that you thought, but instead of using a sleep(), use kqueue() to receive events from the kernel. When there are no events, your process stays suspended.
I see. It's not really polling. No need for a sleep. Thank you for this clear answer.
- How do I handle SIGKILL
You cannot. SIGKILL, by definition, is not handle-able. If sent to your process, your process will never receive it, but it will stop running and be removed from memory. Therefore, if you have any resources that you need to shut down or close in a special way, it's critical that you do so in the timeframe allotted between the TERM and the KILL.
Sorry. I meant How do I handle SIGTERM?
From what I have read, I shall not call fork and exec from a daemon. But can I use GCD? I mean, can I have a serial dispatch queue in a daemon, or use one of those provided by the system?
Thanks for your reply. - E
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden