16 apr 2015 kl. 13:25 skrev Raunak Poddar <raunak.pod...@gmail.com>:
> 
> I have a program and I want to ensure that it has been launched only by 
> launchd (as a daemon) & it should terminate if the user launches it directly 
> (double-click on Finder, terminal). Is there a nifty way of accomplishing 
> this?

A quick and dirty check would be to use getppid() and ensure that it's launchd. 
A better way is probably to check in with launchd (see SampleD.c), but I'm not 
actually sure what happens if you run that manually.

-- 
Per Olofsson, IT-service, University of Gothenburg

_______________________________________________
launchd-dev mailing list
launchd-dev@lists.macosforge.org
https://lists.macosforge.org/mailman/listinfo/launchd-dev

Reply via email to