Question 510
For the described Linux issue — A monitoring script uses exit 0 after detecting a failed prerequisite and is treated as successful by automation — which response is the best match?
Explanation
Correct Answer
The appropriate operation is Return a nonzero exit status on failure and zero only after successful checks. The case hinges on the fact that The shell communicates success and failure to callers through exit status values; a passing check is The calling scheduler marks the intentionally failed prerequisite as failed.
Incorrect Answers
The alternative fits A scripted conditional needs to distinguish an empty variable from a nonempty path safely. The reported issue instead calls for Return a nonzero exit status on failure and zero only after successful checks, as The shell communicates success and failure to callers through exit status values.
This command or configuration addresses a different case: A team wants a reusable command group with arguments and local processing instead of a static alias. Here, The shell communicates success and failure to callers through exit status values, so the targeted action is Return a nonzero exit status on failure and zero only after successful checks.
That option does not correct the stated dependency. In this case, The shell communicates success and failure to callers through exit status values; implement Return a nonzero exit status on failure and zero only after successful checks and check The calling scheduler marks the intentionally failed prerequisite as failed.