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.
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
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)- A12% (7)
- B3% (2)
- C80% (48)
- D5% (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.
The option `-n $pidfile` is not the standard way to specify a PID file with `killproc`; the correct option is `-p`.
The option `-pi` is not a valid option for the `killproc` command.
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.
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
Community Discussion
No community discussion yet for this question.
