CompTIA Linux+ (XK0-006)System ManagementEasy

A technician installs a new logging service package on a Rocky Linux server. The service should automatically start every time the server boots, but the technician does not want it to start immediately during the current session. Which command should the technician run?

  1. Asystemctl start rsyslog-collector
  2. Bsystemctl mask rsyslog-collector
  3. Csystemctl enable --now rsyslog-collector
  4. Dsystemctl enable rsyslog-collector
Show answer & explanation

Correct answer: D. systemctl enable rsyslog-collector

systemctl enable creates the necessary symlink so the unit starts at the next boot without starting it now. --now would also start it immediately, mask would prevent it from ever starting, and start only affects the current session without persisting.

Why the other options are wrong

  • A. Only starts the service now; does not persist across reboots.
  • B. Blocks the unit from starting at all, even manually.
  • C. Would also start the service immediately, which was not desired.

systemctl enable

Creates a symlink in the appropriate target.wants directory so systemd starts the unit automatically at boot, without starting it immediately.

  • enable = configure for boot, does not start now
  • start = start now, not persistent
  • enable --now = both enable and start
  • mask = block unit from being started at all

Memory trick: Enable plants the seed for next boot; start makes it grow now.

More System Management questions