Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Question on using launchd



Ack, at 6/8/06, Mike Kobb said:

1) Is it possible to set up launchd to not launch the process at login, but to shut it down at logout?

It may not be necessary. See http://developer.apple.com/qa/qa2001/qa1133.html for some notifications you can subscribe to that are sent when a user logs out. Granted, the samples are really, really old (in the lifetime of OS X) but they should still be accurate.


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.

Again, notifications are sexy. If you can reload the preferences and handle the changes without a relaunch, you can just send a notification from the preference pane and receive them in the daemon. This is what I do and it works really well.
--



Sincerely, Rosyna Keller Technical Support/Holy Knight/Always needs a hug

Unsanity: Unsane Tools for Insanely Great People

It's either this, or imagining Phil Schiller in a thong.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden

This email sent to email@hidden
References: 
 >Question on using launchd (From: Mike Kobb <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.