NSDistributedNotification Strangeness..
NSDistributedNotification Strangeness..
- Subject: NSDistributedNotification Strangeness..
- From: Charles Bennett <email@hidden>
- Date: Fri, 15 Jun 2001 11:52:33 -0400
This is pretty wierd so I'll try to explain what I'm observing with NSDistributedNotification.
Assumptions: Except where noted, everything I'm doing is done as the root user.
I have a unix daemon that starts at bootup just like Apache.
It starts fine, disconnects from a controlling terminal etc..
the daemon forking code is stright out of "Stevens" and has been used around here for
years.
This daemon creates an objC object that does three things
(just for my test of communication methods)
1: creates and sends info to a named pipe (aka fifo)
2: creates and vends a Distributed Object (run in new thread)
3: posts NSDistributedObjectNotification's
1 and 2 work just fine as a communication method between the daemon and the client.
(although I never see connectionDidDie in the DO client.
3.. There is the rub, and the odd behaviour.
No matter what type of user I login as, the client will not see any of the distributed
notifications until the daemon is killed and restarted. Even if I'm already "root" and
the daemon is owned by and starts as root.
If I'm not logged in as root, I have to "su - root" to "really" be root and restart the daemon. voila! I start seeing
notifications. Now to make it more strange. If I log out (not restart, just logout) and log back in as another user.
I have the SAME problem again. No notifications until the daemon is restarted, though in every case I'm su'ing to root
to do the restart.
I can't tell from the NSDistributedObjectNotification's doc's if it notifiy's
USER wide or SYSTEM wide. Of course there is no easy way to debug this. In that
the notificatios either arrive or not. Starting the daemon in the debugger works
because it's starting after you are logged in and that's not the problem.
Is anyone else out there playing with this type of thing of am I in uncharted waters?
I don't mind burning a "tech support" incident since getting this to work is important
to a product launch. I just don't want to go through that just to find out it's
a "known" or even "unknown bug".
sorry for the long winded post.. These 2am debugging session's are more fun
than a human should be permitted ;-)
thanks
chuck
--
"I have great motivational skills. Everyones always saying how much harder they have to work when I'm around!"
-Homer S