Mac Forums

Mac Forums (http://www.mac-forums.com/forums/)
-   OS X - Development and Darwin (http://www.mac-forums.com/forums/os-x-development-darwin/)
-   -   Getting launchd working (http://www.mac-forums.com/forums/os-x-development-darwin/18505-getting-launchd-working.html)

dr_springfield 05-10-2005 03:40 PM

Getting launchd working
 
Has anyone actually gotten launchd working for running their own TCP/IP daemon?

Unfortunately the launch interface is undocumented (note the suspicious lack of the launch(3) manpage), but from reading launch.h for the API and launchproxy.c for an example, I was able to determine that the correct course of events goes as follows:

launch_data_alloc(LAUNCH_DATA_STRING);
launch_data_set_string(msg, LAUNCH_KEY_CHECKIN);
resp = launch_msg(msg)

launch_data_dict_lookup(resp, LAUNCH_JOBKEY_SOCKETS);
...

Unfortunately I can't get this working -- response launch_data_t ("resp") is of type LAUNCH_DATA_ERRNO. The error is 13 (EACCESS). Apparently my daemon doesn't have permissions to get the response to LAUNCH_KEY_CHECKIN...?

Anyone know how to get this working (or an alternative method to get active FDs from within the daemon?)


All times are GMT -4. The time now is 01:01 PM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.