nerdexam
IBM

000-221 · Question #156

Within the context of a script, what must be considered when using stopsrc to stop a running subsystem?

The correct answer is B. Return code will be zero, regardless of outcome. The stopsrc command always returns exit code zero in scripts, regardless of whether the subsystem actually stopped, making return code checks unreliable for error handling.

System Management

Question

Within the context of a script, what must be considered when using stopsrc to stop a running subsystem?

Options

  • AThe command can only run in the foreground.
  • BReturn code will be zero, regardless of outcome.
  • CReturn code will be non-zero should the subsystem fail to stop.
  • DThe command will wait for the given subsystem to shutdown, before returning.

How the community answered

(68 responses)
  • A
    7% (5)
  • B
    74% (50)
  • C
    15% (10)
  • D
    4% (3)

Why each option

The stopsrc command always returns exit code zero in scripts, regardless of whether the subsystem actually stopped, making return code checks unreliable for error handling.

AThe command can only run in the foreground.

stopsrc is not limited to foreground execution; it sends a stop request asynchronously to the SRC daemon.

BReturn code will be zero, regardless of outcome.Correct

The stopsrc command is designed to always return an exit code of zero regardless of the actual outcome of the stop request. This is a critical scripting concern because a script cannot rely on the return code to determine whether the subsystem successfully stopped - additional verification steps such as lssrc must be used instead.

CReturn code will be non-zero should the subsystem fail to stop.

This is the opposite of the actual behavior - stopsrc returns zero even on failure, not a non-zero code.

DThe command will wait for the given subsystem to shutdown, before returning.

stopsrc sends the stop signal asynchronously and returns immediately without waiting for the subsystem to complete its shutdown.

Concept tested: AIX SRC stopsrc command return code behavior

Source: https://www.ibm.com/docs/en/aix/7.3?topic=s-stopsrc-command

Topics

#stopsrc#SRC subsystem#return code#scripting

Community Discussion

No community discussion yet for this question.

Full 000-221 Practice