Re: alert from a daemon?
Re: alert from a daemon?
- Subject: Re: alert from a daemon?
- From: Nicko van Someren <email@hidden>
- Date: Mon, 21 Jan 2008 17:24:11 +0000
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:
This email sent to email@hidden