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: alert from a daemon?



On 21 Jan 2008, at 09:54, Adrian Ross wrote:

Following up...

Mitch was good enough to point me towards CoreFoundation/ CFUserNotification.h. The function CFUserNotificationDisplayNotice does the trick, although it has no effect unless run by an administrator.

Hmm, my daemon runs as "nobody".

If your daemon is running as Nobody then it may well not have the necessary permissions to install a new version of itself.


I suggest that you write a small, by default faceless, GUI launchd agent. Install it in /Library/LaunchAgents, so that it can be used by all users. Using a combination of the RunAtLoad key and the WatchPaths key in the launchd.plist file you can have the agent start up when the daemon has a new version to install and bring up a GUI as needed. It can then ask the user to authenticate in order to elevate privilege and run a tool which will stop the daemon, install the new version and restart the new daemon.

Cheers,
	Nicko

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >alert from a daemon? (From: Adrian Ross <email@hidden>)
 >Re: alert from a daemon? (From: Adrian Ross <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.