โ† All RHCSA Flashcard Decks

RHCSA Systemd and Service Management Flashcards

6 cards from real RHCSA practice questions. Tap to flip, then mark Knew It or Still Learning โ€” missed cards come back until you master them.

Read the first 6 RHCSA Systemd and Service Management flashcards as text
  1. A system administrator needs to troubleshoot a failing service named `httpd.service`. Which of the following commands provides the most direct and comprehensive way to view all log entries for only that specific service since the system last booted?

    Answer: journalctl -u httpd.service -b

    The `journalctl` command is the standard tool for querying the systemd journal. The `-u` flag filters the output for a specific systemd unit, and the `-b` flag restricts the output to logs from the current boot. This combination is the most precise method for this task.

  2. What is the key difference between disabling a service with `systemctl disable` and masking a service with `systemctl mask`?

    Answer: `disable` prevents the service from starting automatically at boot, but it can still be started manually or as a dependency. `mask` links the service to `/dev/null`, preventing it from being started under any circumstances.

    `systemctl disable` removes the symlinks that cause a service to start at boot time. However, the service can still be started manually or by another dependent service. `systemctl mask` is a more forceful action that creates a symlink from the service unit file to `/dev/null`, making it impossible for systemd to load and start the service at all, even if requested manually or as a dependency.

  3. After creating a new systemd unit file at `/etc/systemd/system/custom.service`, a system administrator tries to start it but receives an error that the unit is not found. Which command must be run first for systemd to recognize the new unit file?

    Answer: systemctl daemon-reload

    Whenever a systemd unit file is added, modified, or deleted on the filesystem, the `systemctl daemon-reload` command must be executed. This command instructs the systemd manager to rescan its configuration directories and reload the unit files from disk, making it aware of any changes.

  4. A server is currently running in the `graphical.target` (runlevel 5). An administrator needs to switch to `multi-user.target` (runlevel 3) immediately to perform maintenance, but wants the server to boot back into `graphical.target` on the next reboot. Which command will achieve this temporary change?

    Answer: systemctl isolate multi-user.target

    The `systemctl isolate` command switches to a different target in the current session only, stopping services that are not part of the new target's dependency chain. It does not change the default target that the system will boot into. `set-default` would make the change persistent.

  5. After editing the main configuration file for a running web server, you need to apply the changes without dropping active user connections. Assuming the service unit supports this functionality, which command is the most appropriate?

    Answer: systemctl reload httpd.service

    The `systemctl reload` command sends a signal to the service to gracefully reload its configuration files without stopping and starting the main process. This is the preferred method for applying configuration changes to services that support it, as it avoids downtime.

  6. Which of the following commands is used to change the default target the system will boot into, making the change persistent across reboots?

    Answer: systemctl set-default graphical.target

    The `systemctl set-default` command is used to set the default target (equivalent to a runlevel) for the system to boot into. This command creates a symbolic link from `/etc/systemd/system/default.target` to the specified target unit, ensuring the setting is persistent.