nerdexam
CompTIA

XK0-004 · 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 c

The correct answer is A. Kill -HUP 1. SIGHUP (signal 1) is the conventional Unix signal used to instruct a running process to reload its configuration or reopen its log file handles, making it the correct choice for reconnecting a containerized web server to its log file after rotation.

Scripting, Containers and Automation

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

(39 responses)
  • A
    85% (33)
  • B
    5% (2)
  • C
    8% (3)
  • D
    3% (1)

Why each option

SIGHUP (signal 1) is the conventional Unix signal used to instruct a running process to reload its configuration or reopen its log file handles, making it the correct choice for reconnecting a containerized web server to its log file after rotation.

AKill -HUP 1Correct

kill -HUP 1 sends SIGHUP (signal number 1) to PID 1, which is the main application process inside a container. SIGHUP is the standard Unix signal that instructs daemons and web servers to reload their configuration and reopen all open file handles, including log files that were rotated. Sending SIGHUP to the container's main process causes the application to reconnect to the current log file, which matches the described vendor signal behavior for resolving the logging gap after rotation.

BKill -USR 1

SIGUSR1 is a user-defined signal available for application-specific custom use, but it is not the standard or conventional signal for log file reopening in web servers and does not match the described behavior.

CKill -TEAM 1

SIGTERM is used to request graceful termination and shutdown of a process, not to trigger a configuration reload or log file reconnection.

DKill -Kill 1

SIGKILL forcibly and immediately terminates the process without allowing any signal handlers to run, which would stop the container entirely rather than reconnect its logging.

Concept tested: SIGHUP signal for daemon log file reload

Source: https://man7.org/linux/man-pages/man7/signal.7.html

Topics

#containers#process signals#HUP signal#log rotation

Community Discussion

No community discussion yet for this question.

Full XK0-004 Practice