
On 16 October 2014 12:33, Peter Platek <peterplatek@gmail.com> wrote:
I think you might want to follow the advice below so your changes don't get overwritten after next update (Adjust for debian of course): *Q: I want to change a service file, but rpm keeps overwriting it in /usr/lib/systemd/system all the time, how should I handle this?*
A: The recommended way is to copy the service file from /usr/lib/systemd/system to /etc/systemd/system and edit it there. The latter directory takes precedence over the former, and rpm will never overwrite it. If you want to use the distributed service file again you can simply delete (or rename) the service file in /etc/systemd/system again.
Debian won't silently overwrite the file in /lib/systemd/system/bind9.service (barring doing some particular configuration to do otherwise!!!); an upgrade would notice the difference, and ask if you want to overwrite the changes. Which points at the notion that there's still a problem; if the options are *supposed* to be configurable, they should go some place where they will be referenced, as opposed to there being some question of overwriting things. Hmm. Looks like the customization location *might* be /etc/systemd/system/multi-user.target.wants/bind9.service Yep, that looks mighty promising. If I edit that, and check systemd status ($ service bind9 status), I get the warning that... Warning: Unit file changed on disk, 'systemctl daemon-reload' recommended. [wait a minute... Seems like a closer relationship...] root@cbbrowne:~# ls -l /etc/systemd/system/multi-user.target.wants/bind9.service lrwxrwxrwx 1 root root 33 Oct 16 13:24 /etc/systemd/system/multi-user.target.wants/bind9.service -> /lib/systemd/system/bind9.service Same file... There's a further curiosity; I run etckeeper, to keep the stuff in /etc under SCM control. If systemd config isn't in /etc, it's not "under control" (in more senses than one!). More research warranted! :-) -- When confronted by a difficult problem, solve it by reducing it to the question, "How would the Lone Ranger handle this?"