On 2024-01-14 12:10, Darryl Gregorash wrote:
On 2024-01-14 02:02, Felix Miata wrote:
The following is the result of saving the edit: # systemctl cat mdcheck_start.timer # /usr/lib/systemd/system/mdcheck_start.timer # This file is part of mdadm. # # mdadm is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version.
[Unit] Description=MD array scrubbing
[Timer] OnCalendar=Sun *-*-* 1:00:00
[Install] WantedBy= mdmonitor.service Also= mdcheck_continue.timer
# /etc/systemd/system/mdcheck_start.timer.d/override.conf OnCalendar=Sat *-*-* 4:00:00 # The override file created by the edit contains only:
OnCalendar=Sat *-*-* 4:00:00
I didn't change any file directly. I added that 04:00 Saturday line in between the marks indicated by opening the systemd object for edit, about 4 lines from top in the blank space. This is totally confusing. Where exactly did you put that line you want to add?
It is not confusing. The pasted text is the direct result of running the command:
systemctl cat mdcheck_start.timer
and it outputs two files, the system one and the override file. The system file is not edited, there is a an override file with a single text line with the "edit". Well, duuh, Carlos. Read closely and you'll see I'm not even talking about that. What I'm asking about is just where did he place the new
On 2024-01-14 05:59, Carlos E. R. wrote: line in the service file.
It should have been placed under the [Timer] title; above or below the existing line should not matter. Try deleting the existing override.conf file, and editing the service file again, this time placing your new line in the proper place.
NO!
That breaks things, specially with updates.
Wrong, wrong, couldn't be more wrong. When you execute "systemctl edit", the original file is left unchanged (which you should have noticed in the output of the systemctl cat command). The modified file is saved as: /etc/systemd/system/<service>.d/override.conf Yes, systemd is smart enough to know when a service file has been modified, so it runs the override file instead of the original. And no, the override file is *NOT* modified in any way during an update. AFAIK at this time, the only way to get rid of it is to physically delete it. If you still want to dispute any of this, I will post the results for my boinc-client service file for you to peruse.
The correct method is what Georg Pfuetzenreuter suggested.
Isn't that precisely what I said when I wrote this?
It should have been placed under the [Timer] title; above or below the existing line should not matter.