LPIC-1 Exam 101 Practice Questions

Linux Professional Institute LPIC-1 Exam 101 (101-500) exam preparation

LPIC-1 Exam 101 practice questions in English: 180 questions with explanations. The mock exam has 60 questions and 90 minutes.

LPIC-1 Exam 101 free question 7 / 10 · Domain 3: GNU and Unix Commands

You ran kill 2210 without specifying a signal for the process with PID 2210. Which command sends the same signal?

  1. kill -9 2210
  2. kill -1 2210
  3. kill -2 2210
  4. kill -15 2210
Show the answer and explanation

Answer: D

Why this is correct
At the start of DESCRIPTION, kill(1) of procps says that the default signal of kill is TERM. In the number table of signal(7), SIGTERM is 15, and this number is the same regardless of the architecture. So kill 2210 sends the same signal as kill -15 2210 (which can also be written kill -TERM 2210 or kill -s TERM 2210). SIGTERM is a request to terminate, and a process can catch it, clean up after itself, such as deleting temporary files, and then exit.

Why the other options are wrong
"kill -9 2210" … Number 9 is SIGKILL. This assumes that, because the command is called kill, it sends a forced kill by default. SIGKILL ends the process without giving it a chance to clean up, so making it the default would mean this rough way of stopping every time.
"kill -1 2210" … Number 1 is SIGHUP, the signal that reports that the controlling terminal was disconnected. Its default action is to terminate, but many daemons use it as a signal to re-read their configuration. It is not the default of kill.
"kill -2 2210" … Number 2 is SIGINT, which stands for an interrupt from the keyboard. It is what is sent to stop a program running in a terminal, and it is not what kill sends without an argument.

Good to remember
The basic order for stopping a process is to send the default TERM first and see what happens, and only if it does not end, to use -9 (KILL). The correspondence between signal names and numbers can be checked with kill -l, and passing a number, as in kill -l 15, prints the name. 1 (HUP), 2 (INT), 9 (KILL), and 15 (TERM) are the ones often asked by number.

Go to the LPIC-1 Exam 101 practice app (10 free questions; purchase unlocks all questions)

See the full practice set