On Sonntag, 16. April 2023 13:56:00 CEST Andrei Borzenkov wrote:
On 16.04.2023 14:02, mh@mike.franken.de wrote:
Hi *,
I keep my own systemd unit files in /usr/local/lib/systemd/system. Enabling them creates a link from the unit file in this directory to for example multiuser.target.wants. But editing them with systemctl edit --full and writing back the edited file creates a new file with the modified contents in /etc/system/system and leaves my file in /usr/local/lib/systemd/system untouched. So I have two files with different contents from now on, which is at least confusing.
No, it is not. systemd had rules how to find unit definition from the day one.
I didn't mean, systemd will get confused, but me :)
Is that really the intended behaviour of systemctl edit?
Yes. It is even documented to work this way.
Yep, I read that afterwards: "If --full is specified, this will copy the original units instead of creating drop-in files." Even in the case of using edit without --full, a copy of the unit file is created - from whatever "known" directory the original file stems from.
Or am I doing something wrong?
TIA.
Bye. Michael.