starting daemons in the startup context
site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com I'm writing a user-level daemon that periodically, in response to RPC calls, runs other apps. By user-level, I mean that it runs as a particular user, typically not an admin user. I need to be able to let the user restart the daemon, too. I'm running into problems with this setup, typically because the apps run by the daemon start crashing after six hours or so of operation, typically like this: FAILED TO GET ASN FROM CORESERVICES so aborting. I also see gethostbyname() failures, etc., presumably because the app can't connect to lookupd. I think this is all because the daemon is running in a 'login' bootstrap context, instead of the 'startup' bootstrap context, and this context has somehow 'decayed'. For instance, when I run % sudo launchctl bslist 7942 bootstrap_info(): 268435459 % which is a very odd result. I see that in http://developer.apple.com/DOCUMENTATION/DARWIN/Conceptual/KernelProgramming..., there's a paragraph saying, ``There are a number of ways to force a program to start in the startup context without rebooting or using ssh. However, these are not robust solutions, and are not recommended. A standard API for starting daemons is under consideration. When an official API becomes available, this chapter will be updated to discuss it.'' Presumably the standard API doesn't exist yet, or that page would have been updated. So what are some of the 'number of ways'? Preferably something that doesn't require the user to be an admin or sudoer. Bill _______________________________________________ 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... This email sent to site_archiver@lists.apple.com
participants (1)
-
Bill Janssen