16 Apr
2015
16 Apr
'15
1:53 p.m.
16 apr 2015 kl. 13:25 skrev Raunak Poddar <raunak.poddar@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