On 2024-01-14 02:02, Felix Miata wrote:
7 days ago I ran 'systemctl cat mdcheck_start.timer' and decided I didn't like either the time or the day of the default, Sunday @01:00, so I did 'systemctl edit mdcheck_start.timer'. 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 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. Then run"systemctl cat mdcheck_start.timer" again to make sure the override.conf file contains all the original lines, plus the new one.
I rebooted twice since. It's 2:20 Saturday as I type this, and mdcheck is running, started by the timer at 01:00. 'systemctl status mdcheck_start.timer' reports: ... systemd[1]: /etc/systemd/system/mdcheck_start.timer.d/override.conf:1: Assignment outside of section. Ignoring ... What more is required to implement my timer change here? As yet, I haven't found an example of making a change to a unit file, rather than an addition or deletion. :(
The editor systemctl uses for editing is not my preference. I think it's nano. I want mcedit. Where do I change the global default editor to my preference? Nothing looks obvious in /etc/sysconfig/, in yast or in /etc/alternatives/. If there's no simple way, and the /etc/alternatives method can be implemented, I'd like to try it. I attempted so based on https://unix.stackexchange.com/questions/408413/change-default-editor-to-vim... but failed due to 'which editor' returning not found.
In SUSE, there is no "editor"; it is "edit" instead, which (at least on my system) points to vim (but I don't have mc installed, so who knows?). So, proceed as Robert Webb suggests, which is just what is posted in that URL, except with mcedit instead of vim.