Re: Why is Leopard annoying my users?
Re: Why is Leopard annoying my users?
- Subject: Re: Why is Leopard annoying my users?
- From: James Bucanek <email@hidden>
- Date: Tue, 20 Nov 2007 11:30:51 -0700
Quinn <mailto:email@hidden> wrote (Tuesday, November 20,
2007 9:35 AM -0000):
A. If your daemon is a real daemon, there should not be any problems
using Mach messaging to talk to it. A real daemon launches in the
global bootstrap namespace, so it can safely register a service and
that service can be seen by all other processes on the system.
In the "if it were a snake it would have bitten me" department,
the simplest solution might be to switch back to Mach ports.
So, one course of action is to try to figure out why your Mach-based
DO failed on 10.5.
B. Looking at your code it's not obvious what's causing DO to create a
TCP socket. Then again, I'm hardly a DO expert |-:
Someone from the Cocoa list has suggested that since I didn't
specify a return socket, that the NSConnection is creating a
generic TCP socket for the return communications. If that's
true, then one solution would be to create two UNIX sockets and
supply both.
I dunno, let's do both (-: Apropos A, can you tell me what caused you
to make the switch from Mach-based DO.
This problem originally came up because I had some background
services that were being launched via cron. (If you're asking
why this wasn't a launchd process, it's because this was a
user-level process and I didn't want to have to ask for admin
privileges to install it. I'm actually still annoyed that Apple
doesn't provide for a "user daemon" class of processes in
launchd ... but I can also imagine what some of the problems
might be too.)
In Leopard, cron processes are launched in their own Mach
namespace, so user applications can't communicate with them. I
was told that the only Interprocess communications solution
available was to use sockets.
Recently, however, I've had to abandon cron because recent
versions of Tiger have now taken to SIGKILLing cron jobs when
the user logs out. So my only solution was to install everything
as a launchd daemon(s).
However, I was also told that child processes started by launchd
deamon were also in a child namespace and can't communicate with
other child (i.e. user) namespaces. Is this true, or will child
processes of a launcnd deamon run in the same Mach namespace as
the parent process? If they run in the same namespace, then
maybe I can go back to using Mach ports.
And apropos B, try setting a
breakpoint on bind and see what's getting bound, what it's bound to,
and what the backtrace looks like.
I'll give that a shot (just out of curiosity of nothing else).
Oh, btw, what's the super class of QRUserBSDSocketPath?
QRUserBSDSocketPath > QRSubPath > QRPath > NSObject
This is part of hierarchy of classes that manage all of the
support files and folder locations for my app (Application
Support files, shared libraries, preferences, log files, managed
documents, etc. etc.). When I switched from Mach ports to socket
files, the socket files just became one more kind of managed file.
--
James Bucanek
_______________________________________________
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