Re: Start and stop a privileged service programmatically
site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Nicola On 10/lug/06, at 19:16, Dave Zarzycki wrote: On Jul 8, 2006, at 12:45 PM, Nicola Vitacolonna wrote: The only questions that remain are: 1) Do you have the source code to the VPN daemon and client? 2) Do you have the time to make some changes to the code? _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... OpenVPN is an open source client/server, but I'd rather avoid mangling the code if possible. And I should also point out that I want to run the *client* (the server is always available on another machine), which can be run as a daemon by passing the --daemon option. Can this really be made to work "on demand"? My initial idea was to build a preference pane to turn the connection on and off. But, for some reason, I cannot make openvpn start up correctly from code. In some more tests I have made, I have noticed a "route: must be root to alter routing table" error when my (authenticated) tool launches openvpn - which baffled me, because the command is supposed to be executed with root privileges (I have verified that uid = 501, euid = 0). I like, however, "Apple's idealized view", if only I could implement it. Where may I find more information: man pages only? 2) Is launchd to be preferred over other methods in this case? And is it the way to go in general? The preferred solution does not involve launchctl or programmatic control whatsoever. In Apple's idealized view of the universe, your VPN daemon would be launch on demand via some IPC based mechanism. This has the nice side effect of implicit correctness. From your client's perspective, the daemon is virtually running all the time. davez This email sent to site_archiver@lists.apple.com
participants (1)
-
Nicola Vitacolonna