Hi all,
I have created two executables: a Daemon, nammed D and a Program nammed P.
When I run P for the first time, it has to initialize the configuration needed by D, that is:
1. create D.plist in /system/library/launchd/
2. launch D using launchctl to avoid the need of reboot
3. Terminate P which will be relaunched by D
Then, every time the mac reboot, D will be launched as Daemon and will launch P. That's all.
So, I think (but maybe I'm wrong ?) that P has to be launched as root for the first time because it needs to write a D.plist in /system/library/launchd/
The question is: How I can progammatically request root rights for P when I run it for the first time ?
Thanks
André.