Question 270
A server clock is wrong, and the operator needs to check time zone and NTP synchronization state. Which command reports both?
- hostnamectl set-hostname app01
- systemd-analyze time
- timedatectl status
- systemd-analyze blame
Explanation
Correct Answer
C:timedatectl reports local time, time zone and synchronization indicators under systemd. It does not replace an NTP daemon's detailed peer statistics.
Incorrect Answers
A:hostnamectl configures host naming through systemd-hostnamed on supported systems; the evidence calls for inspecting system time-zone and synchronization settings, not merely this separate operation.
B:systemd-analyze time reports time spent in firmware, loader, kernel and userspace where available; the task involves inspecting system time-zone and synchronization settings, whereas this addresses another subsystem.
D:systemd-analyze blame ranks unit activation durations; that is not equivalent to inspecting system time-zone and synchronization settings.
Question 271
A systemd service unit has a modified ExecStart command on disk. The operator must make systemd reread the unit and then relaunch the service. Which TWO commands are required? Choose TWO.
- systemctl restart app.service
- systemctl status app.service
- systemctl disable app.service
- systemctl mask app.service
- systemctl daemon-reload
Explanation
Correct Answers
A:systemctl restart app.service stops and then starts the service, replacing the main process under the updated execution command. It follows daemon-reload, which is what makes systemd reread the modified unit definition.
E:daemon-reload refreshes systemd manager configuration and dependency state. It does not by itself restart the modified service.
Incorrect Answers
B:status combines unit state with process and recent journal information; that changes a different part of the system; the requested outcome is rereading changed unit definitions and starting the new executable.
C:disable removes symlinks created by enablement while leaving the unit available for explicit starts; this does not achieve rereading changed unit definitions and starting the new executable on the system described.
D:Masking links the unit name to /dev/null, preventing normal activation by systemd; it will not provide rereading changed unit definitions and starting the new executable under these conditions.
Question 272
A risky unit must be blocked even from dependency-triggered or manual starts. Which systemd action is strongest?
- systemctl daemon-reload
- systemctl start app.service
- systemctl mask app.service
- systemctl disable app.service
Explanation
Correct Answer
C:Masking links the unit name to /dev/null, preventing normal activation by systemd. Disable only removes selected enablement links.
Incorrect Answers
A:daemon-reload refreshes systemd manager configuration and dependency state; the requirement is prohibiting unit activation with a mask, outside the effect of this choice.
B:start activates the unit now without writing enablement symlinks; it does not deliver prohibiting unit activation with a mask, which is decisive in this scenario.
D:disable removes symlinks created by enablement while leaving the unit available for explicit starts; the task involves prohibiting unit activation with a mask, whereas this addresses another subsystem.
Question 273
A service needs automatic startup whenever multi-user.target is reached after boot. Which systemd relationship is commonly installed by enable?
- Restart=on-failure
- .timer unit
- Requires=database.service
- Wants=logger.service
- network-online.target
- WantedBy=multi-user.target
Explanation
Correct Answer
F:An install directive such as WantedBy defines the target's enablement symlink. It does not by itself cause immediate service startup until the relevant target is activated.
Incorrect Answers
A:Restart=on-failure restarts a service after selected failure conditions; that is not equivalent to tying service enablement to the multi-user boot target.
B:A timer unit activates an associated service on its configured schedule; the administrator instead needs tying service enablement to the multi-user boot target; this option serves a different purpose.
C:Requires adds a strong dependency on the named unit, with failure propagation under the applicable startup conditions; it answers a neighboring question rather than tying service enablement to the multi-user boot target.
D:Wants is a weaker activation dependency than Requires; that changes a different part of the system; the requested outcome is tying service enablement to the multi-user boot target.
E:A unit ordered after network-online.target relies on a wait-online provider if it actually needs network connectivity at startup. network.target alone does not promise usable connectivity; this does not achieve tying service enablement to the multi-user boot target on the system described.
Question 274
An administrator wants the journal records for sshd.service from the current boot. Which command fits?
- systemctl status app.service
- systemctl daemon-reload
- systemctl restart app.service
- journalctl -b -u sshd.service
Explanation
Correct Answer
D:journalctl filters journal entries by boot and systemd unit. It can reveal configuration errors associated with a failing daemon.
Incorrect Answers
A:status combines unit state with process and recent journal information; it will not provide reading current-boot messages for one service under these conditions.
B:daemon-reload refreshes systemd manager configuration and dependency state; using it would leave reading current-boot messages for one service unresolved.
C:restart stops and starts the unit, causing its main process to reinitialize; the requirement is reading current-boot messages for one service, outside the effect of this choice.
Question 275
An application is to start at future boots, but administrators do not need it launched right now. Which command is appropriate?
- systemctl enable app.service
- systemctl mask app.service
- journalctl -b -u sshd.service
- systemctl start app.service
Explanation
Correct Answer
A:enable creates the installation symlinks needed to pull in a unit at startup. It does not necessarily start it in the running session.
Incorrect Answers
B:Masking links the unit name to /dev/null, preventing normal activation by systemd; its scope differs from enabling a service for later boots, so it cannot meet the stated requirement.
C:journalctl filters journal entries by boot and systemd unit; that is not equivalent to enabling a service for later boots.
D:start activates the unit now without writing enablement symlinks; the administrator instead needs enabling a service for later boots; this option serves a different purpose.
Question 276
Boot is slow and the administrator wants systemd's elapsed startup timing summary. Which command reports it?
- systemd-analyze time
- systemd-analyze blame
- timedatectl status
- hostnamectl set-hostname app01
Explanation
Correct Answer
A:systemd-analyze time reports time spent in firmware, loader, kernel and userspace where available. It is a starting point before investigating specific units.
Incorrect Answers
B:systemd-analyze blame ranks unit activation durations; this does not achieve estimating startup time by boot phase on the system described.
C:timedatectl reports local time, time zone and synchronization indicators under systemd; it will not provide estimating startup time by boot phase under these conditions.
D:hostnamectl configures host naming through systemd-hostnamed on supported systems; using it would leave estimating startup time by boot phase unresolved.
Question 277
An application must run after its database service starts, but the database is managed as another unit. Which directive handles ordering?
- .target unit
- Restart=on-failure
- After=database.service
- WantedBy=multi-user.target
Explanation
Correct Answer
C:After controls relative startup ordering when both units participate in a transaction. It does not automatically pull the database into the transaction.
Incorrect Answers
A:A target groups and synchronizes systemd units to express boot states; it does not deliver ordering startup after another service, which is decisive in this scenario.
B:Restart=on-failure restarts a service after selected failure conditions; the evidence calls for ordering startup after another service, not merely this separate operation.
D:An install directive such as WantedBy defines the target's enablement symlink; its scope differs from ordering startup after another service, so it cannot meet the stated requirement.
Question 278
A backup task should run hourly and be managed by systemd rather than cron. Which unit type schedules it?
- .timer unit
- After=database.service
- ExecStart=/usr/local/bin/worker
- .target unit
- Requires=database.service
Explanation
Correct Answer
A:A timer unit activates an associated service on its configured schedule. Its OnCalendar expression defines recurring calendar events.
Incorrect Answers
B:After controls relative startup ordering when both units participate in a transaction; it answers a neighboring question rather than scheduling systemd service activation.
C:ExecStart defines the command systemd launches for a service; that changes a different part of the system; the requested outcome is scheduling systemd service activation.
D:A target groups and synchronizes systemd units to express boot states; this does not achieve scheduling systemd service activation on the system described.
E:Requires adds a strong dependency on the named unit, with failure propagation under the applicable startup conditions; it will not provide scheduling systemd service activation under these conditions.
Question 279
An operator needs one command to stop then start a service so a new configuration takes effect. Which action is suitable?
- systemctl start app.service
- systemctl daemon-reload
- systemctl mask app.service
- systemctl restart app.service
Explanation
Correct Answer
D:restart stops and starts the unit, causing its main process to reinitialize. A reload is different and works only when the service supports it.
Incorrect Answers
A:start activates the unit now without writing enablement symlinks; using it would leave performing a full service stop-and-start unresolved.
B:daemon-reload refreshes systemd manager configuration and dependency state; the requirement is performing a full service stop-and-start, outside the effect of this choice.
C:Masking links the unit name to /dev/null, preventing normal activation by systemd; it does not deliver performing a full service stop-and-start, which is decisive in this scenario.
Question 280
A container needs read/write access to an existing host directory rather than a Docker-managed data area. Which mount style fits?
- --network none
- Bind mount of a host path
- Bridge container network
- Overlay network
Explanation
Correct Answer
B:A bind mount exposes a specified host path inside the container. Host-side ownership, labels and security policy determine actual accessibility.
Incorrect Answers
A:The none mode avoids attaching the container to a normal bridge or external network; its scope differs from exposing an explicit host directory into a container, so it cannot meet the stated requirement.
C:A bridge network connects containers on a host through a virtual Linux bridge; the administrator instead needs exposing an explicit host directory into a container; this option serves a different purpose.
D:Overlay networks encapsulate communication across multiple hosts in supported orchestrators; it answers a neighboring question rather than exposing an explicit host directory into a container.