[launchd-dev] LaunchAgents, SecureSocketWithKey, and permissions

Benjamin Reed rangerrick at gmail.com
Sat Jan 26 12:18:09 PST 2008


I've added launchd support to dbus
(https://bugs.freedesktop.org/show_bug.cgi?id=14259) -- however, I
have a problem with permissions if I try to use it on 10.4.

On 10.5, it creates the SecureSocketWithKey socket propertly, but on
10.4, it appears I have 2 sockets:

89990228    0 srwx------    1 ranger   wheel           0 Jan 26 14:44
/tmp/launch-Gi7nee/session
89990177    0 srwx------    1 root     wheel           0 Jan 26 14:42
/tmp/launch-xURB7Y/session

...but the one that gets set in the env var while logged in as ranger
is the xURB7Y one.

On a whim, I thought "hm, maybe I just need to reboot for launchd to
grok it properly."

On reboot, I've started a shell, and now the environment variable is
not set at all.  However, an lsof shows that the socket is being held
by launchd:

$ sudo lsof | grep /session
launchd   158       ranger    9u     unix 0x39cb220       0t0
/tmp/launch-7woJl9/session

...and ls shows it's owned properly:

srwx------   1 ranger  wheel  0 Jan 26 15:09 /tmp/launch-7woJl9/session

Any idea what I need to do to make things set up properly?  Do I need
to set it to KeepAlive or OnDemand=false to make it initialize right,
maybe?

-- 
Benjamin Reed a.k.a. Ranger Rick
Fink, KDE, and Mac OS X development
http://www.racoonfink.com/


More information about the launchd-dev mailing list