exam questions

Exam XK0-005 All Questions

View all questions & answers for the XK0-005 exam

Exam XK0-005 topic 1 question 17 discussion

Actual exam question from CompTIA's XK0-005
Question #: 17
Topic #: 1
[All XK0-005 Questions]

A Linux administrator would like to use systemd to schedule a job to run every two hours. The administrator creates timer and service definitions and restarts the server to load these new configurations. After the restart, the administrator checks the log file and notices that the job is only running daily. Which of the following is MOST likely causing the issue?

  • A. The checkdiskspace.service is not running.
  • B. The checkdiskspace.service needs to be enabled.
  • C. The OnCalendar schedule is incorrect in the timer definition.
  • D. The system-daemon services need to be reloaded.
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Veteran903
Highly Voted 2 years, 5 months ago
Hello all, I respectfully disagree, answer is correct, its D, there is nothing wrong with the OnCalendar, you ALWAYS need to reload system-daemon after you change or update configurations, this is how you make the system aware of the changes, This will rerun all generators, reload all unit files, and recreate the entire dependency tree.
upvoted 5 times
Nvoid
2 years, 5 months ago
They did reload system-daemon, by rebooting the server after the change. Read the question again.
upvoted 2 times
Veteran903
2 years, 5 months ago
restarting the server DO NOT reload de demon sir, you must do it manually or using an script but NEVER by restarting the server....the answer is D, you all are not seeing through this question...if you make changes you MUST MANUALLY reload the demon to make the system aware of the change.
upvoted 3 times
mrtwister76
1 year, 11 months ago
When you restart a Linux server, the init system (such as systemd) automatically reloads the unit files, so you don't need to explicitly run the command systemctl daemon-reload to reread the unit files. The systemctl daemon-reload command is typically used when you make changes to the unit files manually and want to inform the init system to reload the updated configuration without restarting the entire server. This command tells systemd to reparse the unit files and update its internal configuration. However, during a server restart, systemd performs a complete reload of the unit files as part of the initialization process. It reads the unit files from their defined locations and applies the configuration without the need for an explicit daemon-reload command. So, when you restart the server, systemd will automatically reload the unit files, ensuring that the updated configuration is applied, and the services are started based on the latest settings. The correct answer is C. :)
upvoted 4 times
...
...
...
...
Mike313
Most Recent 8 months, 2 weeks ago
Selected Answer: C
The answer is C It CANNOT be A, B, simply because the job would not execute AT ALL if there was an issue with the service. It also CANNOT be D as if you restarted the server, the daemon would automatically be reloaded. You also would not see the job executed at all if there was an issue with the daemon recognizing the changes. There is no need to manually reload the daemon as other answers have claimed.
upvoted 2 times
...
Alizadeh
1 year, 8 months ago
Selected Answer: C
The correct answer is C. The OnCalendar schedule is incorrect in the timer definition.
upvoted 1 times
...
linux_admin
2 years, 2 months ago
C. The OnCalendar schedule is incorrect in the timer definition. The issue of the job only running daily is likely due to an incorrect OnCalendar schedule in the timer definition. The OnCalendar directive is used in the timer definition to specify the schedule on which the timer should run. If the schedule is incorrect, the timer will not run as expected. For example, if the administrator wants the job to run every two hours, the OnCalendar directive in the timer definition should be set to *:0/2. To resolve the issue, the administrator should check the timer definition and make sure that the OnCalendar schedule is set correctly. After making the necessary changes, the administrator should reload the timer and service definitions and check the log file again to see if the job is running as expected.
upvoted 4 times
linux_admin
2 years, 2 months ago
In the previous question, the answer choice D was "The system-daemon services need to be reloaded." This answer is not the most likely cause of the issue because reloading the system-daemon services will not fix an incorrect OnCalendar schedule in the timer definition. The OnCalendar directive is used in the timer definition to specify the schedule on which the timer should run. If the schedule is incorrect, the timer will not run as expected, regardless of the state of the system-daemon services. The most likely cause of the issue, as stated in answer choice C, is an incorrect OnCalendar schedule in the timer definition. To resolve the issue, the administrator should check the timer definition and make sure that the OnCalendar schedule is set correctly.
upvoted 4 times
...
...
KnifeClown1
2 years, 2 months ago
Selected Answer: C
When using systemd timers, the "OnCalendar" option is used to define when the job should run. By default, systemd timers are configured to use UTC time. If the administrator specified an incorrect OnCalendar schedule, the timer may not run as expected. To schedule a job to run every two hours, the correct OnCalendar schedule should be "0 */2 * * *". This will run the job every two hours, starting at the top of the hour (i.e., at 0 minutes past the hour). If the administrator did not specify the correct OnCalendar schedule, the timer may be set to run daily or at some other incorrect interval, which would explain the behavior observed in the log file.
upvoted 4 times
...
Nvoid
2 years, 5 months ago
Selected Answer: C
Picking C Here.
upvoted 4 times
...
SaadiaS
2 years, 5 months ago
*:0/2 The task will be executed every two minutes starting from the minute 0 https://linuxconfig.org/how-to-schedule-tasks-with-systemd-timers-in-linux
upvoted 1 times
SaadiaS
2 years, 5 months ago
Selected answer C
upvoted 2 times
...
...
ryanzou
2 years, 6 months ago
Selected Answer: C
I prefer C
upvoted 4 times
...
bjornborg
2 years, 6 months ago
Selected Answer: C
OnCalendar setting is wrong. If it were D, it wouldn't run at all, but it's running every two hours
upvoted 4 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago