LCA Process Management & System Services 1 — Questions and Answers
Question 1: Which command displays all running processes in a hierarchical tree format showing parent-child relationships?
- ps aux
- pstree (Correct answer)
- top
- htop
Correct answer: pstree
pstree displays processes in a tree structure that clearly shows parent-child relationships between processes.
Question 2: What signal number is used to forcefully terminate a process, bypassing any cleanup handlers?
- 1 (SIGHUP)
- 9 (SIGKILL) (Correct answer)
- 15 (SIGTERM)
- 18 (SIGCONT)
Correct answer: 9 (SIGKILL)
SIGKILL (signal 9) immediately terminates a process at the kernel level without allowing the process to perform any cleanup.
Question 3: Which systemctl command enables a service to start automatically at system boot?
- systemctl start
- systemctl activate
- systemctl enable (Correct answer)
- systemctl boot
Correct answer: systemctl enable
systemctl enable creates the necessary symlinks so the service is started during the appropriate boot target automatically.
Question 4: What is the effect of running a process with a higher nice value such as 'nice +19'?
- The process receives higher CPU scheduling priority
- The process receives lower CPU scheduling priority (Correct answer)
- The process runs in the background automatically
- The process becomes immune to termination signals
Correct answer: The process receives lower CPU scheduling priority
Higher nice values (up to +19) indicate lower scheduling priority, meaning the process yields CPU time to other processes.
Question 5: Which file is the system-wide crontab that includes a username field for specifying which user runs each job?
- /etc/cron.d/root
- /etc/crontab (Correct answer)
- /var/spool/cron/root
- /etc/cron.allow
Correct answer: /etc/crontab
/etc/crontab is the system-wide crontab file with an extra username field, distinguishing it from per-user crontabs.
Question 6: Which command shows the current runtime status, recent log entries, and PID of a systemd-managed service?
- systemctl info
- systemctl show
- systemctl status (Correct answer)
- systemctl inspect
Correct answer: systemctl status
systemctl status displays the service state, active PID, recent journal entries, and other runtime details in a concise summary.
Question 7: Which command sends a signal to all processes matching a given name without requiring the PID?
- kill
- pkill (Correct answer)
- killall -n
- sigkill
Correct answer: pkill
pkill sends signals to processes based on their name or other attributes, eliminating the need to look up PIDs first.
Which command displays all running processes in a hierarchical tree format showing parent-child relationships?