• 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: launchd wrong behavior for nonexistent paths and crashed services
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: launchd wrong behavior for nonexistent paths and crashed services


  • Subject: Re: launchd wrong behavior for nonexistent paths and crashed services
  • From: Kevin Van Vechten <email@hidden>
  • Date: Wed, 24 Sep 2008 10:49:31 -0700


On Sep 24, 2008, at 2:41 AM, Stéphane Sudre wrote:

On Sep 15, 2008, at 7:01 PM, Terry Lambert wrote:

On Sep 15, 2008, at 9:20 AM, Cristescu Alexandru <email@hidden > wrote:
Hello all,

launchd tries to restart indefinitely some service in
the following two cases:

1) launchd plist with wrong ProgramArguments key

"
Throttling respawn: Will start in 10 seconds
posix_spawnp("<ProgramArguments>", ...): No such file
or directory
"

The problem is very annoying if some other application
waits for this service to start.

I don't see a reasonable failure mode for this case, since if program B needs service A, it needs service A. You might argue for a cascade failure, where if service A won't load, B should fail in its attempt to contact A rather than launchd answering the phone and being unable to hand off the connection to A.


On the other hand, you could argue that while what it's trying to launch doesn't currently exist, it will in the future as a result of a not yet completed operation (a network mount, a disk mount for a disk currently being fsck'ed, a thumb drive containing your ssh keys being inserted, or the binary is in fact being generated, etc.).

You could also argue that "the plist needs fixed" and/or "do not install busted plists in the first place".

Since there's no way to distinguish a transient vs. Permanent failure, and you presumably intentionally installed it, you intended launchd to keep trying.

Just to point out a real case where trying to relaunch every time without a max retries is problematic:


In Mac OS X 10.5.4 (I haven't checked if this has been fixed in 10.5.5), AFAIK, if you do the following things:

1. Turn AirPort On
2. Enable Internet Sharing via AirPort
3. Turn AirPort Off
4. Restart

Your console.log and system.log will be filled with tons of these records:

Sep 24 11:37:59 xxxxxxxx InternetSharing[513]: Internet Sharing shutting down
Sep 24 11:37:59 xxxxxxxx com.apple.launchd[1] (com.apple.InternetSharing[513]): Exited with exit code: 1
Sep 24 11:37:59 xxxxxxxx com.apple.launchd[1] (com.apple.InternetSharing): Throttling respawn: Will start in 10 seconds
Sep 24 11:38:09 xxxxxxxx InternetSharing[514]: Internet Sharing shutting down
Sep 24 11:38:09 xxxxxxxx com.apple.launchd[1] (com.apple.InternetSharing[514]): Exited with exit code: 1
Sep 24 11:38:09 xxxxxxxx com.apple.launchd[1] (com.apple.InternetSharing): Throttling respawn: Will start in 10 seconds

Using the SuccessfulExit condition is useful in cases like this. If InternetSharing sees there's nothing to do, and exits successfully, the job wont' be restarted until another condition is met. Please file a radar on this specific issue.


- Kevin


_______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: launchd wrong behavior for nonexistent paths and crashed services
      • From: Stéphane Sudre <email@hidden>
References: 
 >launchd wrong behavior for nonexistent paths and crashed services (From: Cristescu Alexandru <email@hidden>)
 >Re: launchd wrong behavior for nonexistent paths and crashed services (From: Terry Lambert <email@hidden>)
 >Re: launchd wrong behavior for nonexistent paths and crashed services (From: Stéphane Sudre <email@hidden>)

  • Prev by Date: Re: launchd wrong behavior for nonexistent paths and crashed services
  • Next by Date: Re: launchd wrong behavior for nonexistent paths and crashed services
  • Previous by thread: Re: launchd wrong behavior for nonexistent paths and crashed services
  • Next by thread: Re: launchd wrong behavior for nonexistent paths and crashed services
  • Index(es):
    • Date
    • Thread