Re: Getting SIGHUP in a DO process launched by NSTask
Re: Getting SIGHUP in a DO process launched by NSTask
- Subject: Re: Getting SIGHUP in a DO process launched by NSTask
- From: Quinn <email@hidden>
- Date: Tue, 11 Sep 2007 10:54:51 +0100
At 15:42 -0400 8/9/07, Peter Sichel wrote:
Checking Stevens APUE it says SIGHUP is sent to the "Session Leader" but
I'm not sure how this translates to an NSRunLoop or what else might
prevent SIGHUP from being delivered.
This is only relevant if the SIGHUP is being delivered via the TTY
subsystem. A SIGHUP that's directed at a process (via
<x-man-page://1/kill> or <x-man-page://2/kill>) will always be
delivered to that process.
Are you sure that you have permission to signal this process? Are
you checking the result from <x-man-page://2/kill>?
Are you sure that something in the target process isn't disabling
reception of SIGHUP? You can check this with GDB. Attach to the
process and call signal manually:
$ gdb
GNU gdb 6.3.50-20050815 (Apple version gdb-573) [...]
(gdb) attach TextEdit
[...]
(gdb) call (void*)signal(1, 0)
$1 = (void *) 0x0
In the above, 1 == SIGHUP and 0 == SIG_DFL. So the current value of
SIGHUP is SIG_DFL.
* * *
ps Please assure me that you're configuration reload code is
coordinated with your runloop. Otherwise bad stuff will happen.
CFLocalServer has an example of how to achieve this coordination.
See the InstallSignalToSocket routine in "Common.c".
<http://developer.apple.com/samplecode/CFLocalServer/index.html>
S+E
--
Quinn "The Eskimo!" <http://www.apple.com/developer/>
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden