site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Unfortunately, I need this to work, well, today if possible. ;-) Thanks! --Mike On Jun 8, 2006, at 4:37 PM, Dave Zarzycki wrote: Will you be attending WWDC? Can you wait for Leopard? davez On Jun 8, 2006, at 3:55 PM, Mike Kobb wrote: Greetings, So, I have two questions: Thanks in advance, --Mike _______________________________________________ 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... I'm sorry if I mis-typed. It's login and logout that I care about. Not boot or shutdown (except insofar as shutdown implies logout). I want them to be able to choose to launch it at login, or do it manually. Then, if it's running when they log out (whichever of those two methods they chose), I want it to quit. Obviously, this would be trivial if it were a Mac app instead of a BSD process, but unfortunately I don't have that luxury at this time... Why the asymmetric requirement of launching at boot, but exiting at logout (as opposed to at boot/shutdown or login/logout)? I'm working on a MacOS preference pane that is used to configure the options of a faceless background process (a music server). This process is a BSD process for historical reasons, but will run under the privileges of a particular user, and not as root. I want to have a pop-up in the prefs pane that allows the user to choose to manually launch the server (by clicking a "Start" button in the pane, or to have the server launch at startup. Either way, I want to be sure that the server quits when they log out. It seems like launchd is likely to be what I want, but there are a few things I could use some help with. I have figured out how to create the appropriate plist to make the server launch at login and quit at shutdown, and that seems to work fine. 1) Is it possible to set up launchd to not launch the process at login, but to shut it down at logout? 2) I want this all to be controlled by my preference pane. Obviously, it's no trouble to get it to write out the required plist file, but the part I'm not sure about is how to do the equivalent of a "launchctl load" or "launchctl unload" operation. I could exec this, I guess, but I prefer to use a proper C API rather than the exec mechanism whenever I can. I couldn't make heads or tails out of launch.h, I'm afraid. This email sent to site_archiver@lists.apple.com