nerdexam
Cisco

350-601 · Question #416

Refer to the exhibit. A developer must create a Bash script that performs a Chef Client reload in the event of a system reset. Which command completes the script?

The correct answer is C. killproc -p $pidfile $exec -HUP. To reload the Chef Client process in a Bash script, the killproc command is used to send a SIGHUP signal to the process identified by its PID file and executable.

Automation

Question

Refer to the exhibit. A developer must create a Bash script that performs a Chef Client reload in the event of a system reset. Which command completes the script?

Exhibit

350-601 question #416 exhibit

Options

  • Akillproc -n $pidfile $exec -SIGHUP
  • Bkillproc -pi $pidfile $exec -HUP
  • Ckillproc -p $pidfile $exec -HUP
  • Dkillproc -n $pidfile $exec -HUP

How the community answered

(60 responses)
  • A
    12% (7)
  • B
    3% (2)
  • C
    80% (48)
  • D
    5% (3)

Why each option

To reload the Chef Client process in a Bash script, the `killproc` command is used to send a SIGHUP signal to the process identified by its PID file and executable.

Akillproc -n $pidfile $exec -SIGHUP

The option `-n $pidfile` is not the standard way to specify a PID file with `killproc`; the correct option is `-p`.

Bkillproc -pi $pidfile $exec -HUP

The option `-pi` is not a valid option for the `killproc` command.

Ckillproc -p $pidfile $exec -HUPCorrect

The command `killproc -p $pidfile $exec -HUP` correctly uses `killproc` with the `-p` option to specify the PID file and `-HUP` to send the SIGHUP signal, which typically instructs a process like Chef Client to reload its configuration.

Dkillproc -n $pidfile $exec -HUP

The option `-n $pidfile` is not the standard way to specify a PID file with `killproc`; the correct option is `-p`.

Concept tested: Linux process management with killproc and SIGHUP

Source: https://man7.org/linux/man-pages/man8/killproc.8.html

Topics

#Bash scripting#Process management#Chef Client#Linux utilities

Community Discussion

No community discussion yet for this question.

Full 350-601 Practice