Re: launchd wrong behavior for nonexistent paths and crashed services
Re: launchd wrong behavior for nonexistent paths and crashed services
- Subject: Re: launchd wrong behavior for nonexistent paths and crashed services
- From: Cristescu Alexandru <email@hidden>
- Date: Wed, 17 Sep 2008 06:30:21 -0700 (PDT)
> 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("", ...): 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.
> 2) a service keeps crashing
>
> CrashReporter never shows even if I have the
> CrashReporterPrefs on "Developer" level. It is true
> that it says: "Display the Unexpectedly Quit dialog
> for all the processes run by the user".
Is this the system launchd, or the per-session launchd? You will only
get the dialog if it's
something that's in the current GUI context
(search for "CrashReporter" on for more
details).
> Mac OS X 10.4 had a limit
> (LAUNCHD_FAILED_EXITS_THRESHOLD). What was the reason
> to remove it ?
You could as Dave or file a bug. But see above; there are legitimate
reasons for persistently retrying. Probably they outweighed the
likelihood of an actually broken plists remaining installed or
exporting a service legitimately required by some other process and
the system remaining functional.
-- Terry
1. If option 'KeepAlive' is more powerful than the old 'OnDemand' from Tiger, why there isn't an (sub)option, something like 'MaxRetries', to control the number of successive failures before launchd aborts the task?
2. Why this new comportment to retry infinitely is not documented?
_______________________________________________
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