RHCSA RHCSA Systemd and Service Management 4 — Questions and Answers
Question 1: Which systemd unit type is used to mount a filesystem defined in /etc/fstab at a specific path?
- .service
- .mount (Correct answer)
- .path
- .automount
Correct answer: .mount
`.mount` units represent filesystem mount points and correspond to entries in `/etc/fstab`.
Question 2: What is the purpose of `systemd-analyze blame`?
- Identifies which units caused the last system crash
- Lists each unit and the time it took to initialize during boot (Correct answer)
- Shows units that failed during the last boot
- Displays units that are blocking the current target
Correct answer: Lists each unit and the time it took to initialize during boot
`systemd-analyze blame` shows each service unit's initialization time, helping identify boot bottlenecks.
Question 3: A `Type=forking` service unit is used when the process does what?
- Spawns multiple worker threads
- Daemonizes by forking and having the parent exit (Correct answer)
- Uses socket activation
- Requires a separate notify socket
Correct answer: Daemonizes by forking and having the parent exit
`Type=forking` is for traditional daemons that fork a child process and exit the parent; systemd tracks the child.
Question 4: Which command creates a systemd override file for `httpd.service` using a text editor?
- systemctl edit --full httpd.service
- systemctl edit httpd.service (Correct answer)
- systemctl override httpd.service
- systemctl modify httpd.service
Correct answer: systemctl edit httpd.service
`systemctl edit httpd.service` opens an editor for a drop-in override file without replacing the original unit.
Question 5: What does `systemctl kill -s SIGKILL httpd.service` do differently from `systemctl stop httpd.service`?
- It only kills the main process, not child processes
- It sends SIGKILL directly to all processes in the service's cgroup, bypassing ExecStop= (Correct answer)
- It stops the service and disables it permanently
- It marks the service as failed before killing it
Correct answer: It sends SIGKILL directly to all processes in the service's cgroup, bypassing ExecStop=
`systemctl kill` sends a signal directly to all cgroup members, while `stop` runs the `ExecStop=` sequence.
Question 6: In a systemd `.socket` unit, which directive specifies the port or path the socket listens on?
- ListenStream= (Correct answer)
- BindTo=
- AcceptPort=
- SocketPath=
Correct answer: ListenStream=
`ListenStream=` in a `.socket` unit defines the TCP port or Unix socket path for stream (TCP) socket activation.
Question 7: Which target is equivalent to traditional runlevel 3 (multi-user, no GUI)?
- graphical.target
- rescue.target
- multi-user.target (Correct answer)
- basic.target
Correct answer: multi-user.target
`multi-user.target` is the systemd equivalent of SysV runlevel 3: full multi-user mode without a graphical interface.
Which systemd unit type is used to mount a filesystem defined in /etc/fstab at a specific path?