• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to get scripting to work without NSApplication
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to get scripting to work without NSApplication


  • Subject: Re: How to get scripting to work without NSApplication
  • From: Jason Bobier <email@hidden>
  • Date: Sun, 9 Dec 2001 23:32:29 -0800

This is a background damon running as root. I only need to handle the AEQuit event so that I can cleanup our sdk before the damon is terminated.

Currently I am catching SIGTERM and doing the cleanup there. I was told that this has issues though because cocoa can't handle being called from signal handlers.

One thing that I did just notice though. NSNotificationCenter is thread-safe and re-entrant. Does this mean that I could send a notification to myself from a signal handler? If so, that would do the job.

Thanx,

Jason

On Sunday, December 9, 2001, at 11:03 PM, Scott Anguish wrote:


On Monday, December 10, 2001, at 01:05 AM, Jason Bobier wrote:

Hey folks, I have a Foundation/NSRunLoop based damon that I would like to support the Required Suite in. Aren't we supposed to be doing this? I've read all of the Cocoa/AppleScript docs, and it mentions that we should support the Required Suite, but doesn't really tell how to do it. Nor can I find the 'oapp' event mentioned anywhere in there.

BTW, I am trying to do this because it appears to be the only way to perform some cleanup (for example, closing PGP's key database) when a Cocoa based app is quit during shutdown.



Does it run only for a single user at a time? (that is, started by the user upon their login, and with their user id?)

If so, why not just actually use NSApplication and make it a faceless background app?

Otherwise, I'd see issues of security popping up (a daemon running as root being scripted by a user that isn't.. and this seems like something that could be done without actually having to edit the application to exploit.. just by modifying the info.plist)


--
Jason A. Bobier email@hidden
Tech Lead, PGP Macintosh Products http://www.prismatix.com/
Network Associates, Inc. Nothing's constant

PGPKey: <http://keys.pgp.com:11371/pks/lookup?op=get&search=0xF6F83318>
Fingerprint: 7809 7E6E BCCA 903D 4618 9740 EB10 9DF9 F6F8 3318


  • Follow-Ups:
    • Re: How to get scripting to work without NSApplication
      • From: Ingvar Nedrebo <email@hidden>
References: 
 >Re: How to get scripting to work without NSApplication (From: Scott Anguish <email@hidden>)

  • Prev by Date: Re: Hotkeys in Cocoa using undocumented CoreGraphics calls
  • Next by Date: Re: Hotkeys in Cocoa using undocumented CoreGraphics calls
  • Previous by thread: Re: How to get scripting to work without NSApplication
  • Next by thread: Re: How to get scripting to work without NSApplication
  • Index(es):
    • Date
    • Thread