Re: Mach Bootstrap_create_server, "server_command" parameter
Re: Mach Bootstrap_create_server, "server_command" parameter
- Subject: Re: Mach Bootstrap_create_server, "server_command" parameter
- From: Michael Prenez-Isbell <email@hidden>
- Date: Mon, 16 Feb 2009 16:50:48 -0500
- Thread-topic: Mach Bootstrap_create_server, "server_command" parameter
Excellent--thank you!
On 2/16/09 4:32 PM, "Damien Sorresso" <email@hidden> wrote:
> On Feb 16, 2009, at 1:05 PM, Michael Prenez-Isbell wrote:
>>> Please make your job a launchd job instead of using
>>> bootstrap_create_server(), which is deprecated.
>>
>> Thank you Damien. You I hate to ask, but could you offer a code
>> example?
>> It's deprecated for Mach IPC too?
>>
>> Here's what I am doing now to bootstrap, register a service and
>> check it in:
>>
>> ------------
>>
>> kr = bootstrap_create_server(bootstrap_port, "/usr/sbin/notifyd",
>> getuid(), FALSE, &private_port);
>> EXIT_ON_MACH_ERROR("bootstrap_create_server", kr,
>> BOOTSTRAP_SUCCESS);
>>
>> kr = bootstrap_create_service(private_port, SERVICE_NAME,
>> &server_port);
>> EXIT_ON_MACH_ERROR("bootstrap_create_service", kr,
>> BOOTSTRAP_SUCCESS);
>>
>> kr = bootstrap_check_in(private_port, SERVICE_NAME, &server_port);
>> EXIT_ON_MACH_ERROR("bootstrap_check_in", kr, BOOTSTRAP_SUCCESS);
>>
>> printf("server_port = %d\n", server_port);
>>
>> // for (;;) { // server loop
>>
>> ----------
>>
>> What should I do instead...I'll go lookup how to do a launchd call
>> from OS
>> X...
>
>
> Please see the following documentation.
>
> launchd(8)
> launchd.plist(5)
> launchctl(1)
> http://developer.apple.com/technotes/tn2005/tn2083.html#SECDAEMONOMICON
>
> When you're a launchd job, all you need to do is call
> bootstrap_check_in(), and you'll get a receive right back for the Mach
> service you've specified in your launchd.plist(5).
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden