Skip navigation.
 
mlRe: alert from a daemon?
FROM : Nicko van Someren
DATE : Mon Jan 21 18:24:11 2008

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

Related mailsAuthorDate
mlalert from a daemon? Adrian Ross Jan 21, 06:59
mlRe: alert from a daemon? Adrian Ross Jan 21, 10:54
mlRe: alert from a daemon? Jens Miltner Jan 21, 11:03
mlRe: alert from a daemon? Kyle Sluder Jan 21, 16:52
mlRe: alert from a daemon? Nicko van Someren Jan 21, 18:24
mlRe: alert from a daemon? Adrian Ross Jan 22, 03:38
mlRe: alert from a daemon? Kyle Sluder Jan 22, 04:03
mlRe: alert from a daemon? Kyle Sluder Jan 22, 04:05