On 2026-02-19 01:09, Hal Murray via devel wrote:
I
tried editing /usr/lib/systemd/system/ntpd.service, but the next install
undid that.
Side point: You should not edit files in /usr/lib/systemd for exactly
this reason. Depending on the circumstances and/or personal taste, you
should either A) use a drop-in file, or B) override the unit by copying
it to /etc/systemd and editing there.
My personal taste is to use drop-in files whenever practical. That way,
I still pick up other changes to the distro/upstream provided service
file. It also plays well with configuration management systems like
Ansible. Note that you can have multiple drop-in files for different
purposes, which may or may not matter to you (but can be really nice at
even modest scale, again when using something like Ansible).
Both options are available using `systemctl edit UNIT`, which does
things like automatically launch your $EDITOR. Without a flag, you will
get option A, a drop-in file named override.conf. If you add the
`--full` flag, it will do option "B" for you.
Note that a Unit can have multiple ExecStart commands. So in this case
where you want to modify the ExecStart (as opposed to just add another
command), your drop-in file needs to first clear ExecStart, like this:
[Service]
ExecStart=
ExecStart=/usr/sbin/ntpd -g -N -u ntp:ntp -YOUR -NEW -OPTIONS
If you are replacing the whole file (option "B"), then of course you can
edit the existing ExecStart directly.
--
Richard
_______________________________________________
devel mailing list
[email protected]
https://lists.ntpsec.org/mailman/listinfo/devel