[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Twice load - rndc.key ?



On Mon, 11 Jul 2022 13:40:32 -0600
Charles Curley <charlescurley@charlescurley.com> wrote:

> On Mon, 11 Jul 2022 21:01:48 +0200
> Maurizio Caloro <maurizio@caloro.ch> wrote:

> > 
> > # cat /lib/systemd/system/named.service  
> 
> First mistake: you should not be editing files in /lib/systemd/.
> Instead copy the file to edit into /etc/systemd/, and edit it there. I
> believe there is a systemd command that will do that for you if
> necessary. The reason is that when an upgrade comes along, it will
> stomp on any changes you have made in /lib/systemd/.

If you want to supersede the entire unit file from /lib/systemd/ so
that no future package updates to that file will have any effect at
all, then yes. Copy the unit file to /etc/systemd/[system|user]/ as
appropriate and edit it. If you want to selectively override only
specific directives rather than supersede the unit completely, the easy
way is "systemctl edit <unit>". That command automatically creates for
you an appropriately named "<unit>.d" drop-in directory below
/etc/systemd, creates a .conf file in the drop-in directory, and
launches an editor where you can define the directives you want.

Caveat: when using drop-in overrides, values you set are generally
*added* to whatever was set before. If you want to *replace* the value
of a particular directive, you have to explicitly set it to null first,
on a line by itself, like:
ExecStartPre=
...and *then* add a line setting it to whatever you want.

I got some very confusing results when overriding .timer files before I
learned that detail.

Cheers!
 -Chris


Reply to: