XK0-005 · Question #369
A system administrator is troubleshooting a web server that runs in a container. After the log is retained, the container occasionally stops logging to a log file. Fortunately, the vendor provides a…
The correct answer is A. Kill -HUP 1. To signal a containerized application to reconnect to a log file without restarting, sending the HUP signal to process ID 1 is the most appropriate action. This commonly triggers applications to reload configurations or re-open log files.
Question
A system administrator is troubleshooting a web server that runs in a container. After the log is retained, the container occasionally stops logging to a log file. Fortunately, the vendor provides a custom signal that allows the application to reconnect to the log file. Which of the following would be BEST for the administrator to run the containers?
Options
- AKill -HUP 1
- BKill -USR 1
- CKill -TEAM 1
- DKill -Kill 1
How the community answered
(27 responses)- A70% (19)
- B11% (3)
- C15% (4)
- D4% (1)
Why each option
To signal a containerized application to reconnect to a log file without restarting, sending the HUP signal to process ID 1 is the most appropriate action. This commonly triggers applications to reload configurations or re-open log files.
The `kill -HUP` command sends a SIGHUP signal to the specified process. Many Linux applications are designed to respond to SIGHUP by reloading their configuration files and reopening their log files, making it the standard method to achieve this without restarting the application. In a container, PID 1 is often the main application process or an init system that passes signals to the application.
`kill -USR` sends a user-defined signal, which would only work if the vendor explicitly configured the application to respond to it for log file reconnection, and it's less common for this specific task than SIGHUP. C: `kill -TEAM` is not a standard Unix signal and would result in an error. D: `kill -KILL` sends a SIGKILL signal, which immediately terminates the process without allowing it to perform any cleanup or graceful shutdown, making it unsuitable for reconnecting to a log file.
Concept tested: Linux signals, container process management
Source: https://man7.org/linux/man-pages/man7/signal.7.html
Topics
Community Discussion
No community discussion yet for this question.