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
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 mails | Author | Date |
|---|---|---|
| Adrian Ross | Jan 21, 06:59 | |
| Adrian Ross | Jan 21, 10:54 | |
| Jens Miltner | Jan 21, 11:03 | |
| Kyle Sluder | Jan 21, 16:52 | |
| Nicko van Someren | Jan 21, 18:24 | |
| Adrian Ross | Jan 22, 03:38 | |
| Kyle Sluder | Jan 22, 04:03 | |
| Kyle Sluder | Jan 22, 04:05 |






Cocoa mail archive

