systemctl edit for own unit files in /usr/local/lib/systemd/system
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. Is that really the intended behaviour of systemctl edit? Or am I doing something wrong? TIA. Bye. Michael.
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.
Is that really the intended behaviour of systemctl edit?
Yes. It is even documented to work this way.
Or am I doing something wrong?
TIA.
Bye. Michael.
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.
Hello, In the Message; Subject : systemctl edit for own unit files in /usr/local/lib/systemd/system Message-ID : <4822812.31r3eYUQgx@transformer> Date & Time: Sun, 16 Apr 2023 13:02:55 +0200 mh@mike.franken.de has written:
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. Is that really the intended behaviour of systemctl edit? Or am I doing something wrong?
I'm not sure what you mean by editing units, but maybe the Editing provided units section would be helpful? https://wiki.archlinux.org/title/Systemd#Editing_provided_unit_file Regards. --- ┏━━┓彡 野宮 賢 mail-to: nomiya @ lake.dti.ne.jp ┃\/彡 ┗━━┛ "She continues to deeply divide opinion, nearly a decade after her death in 2013, due to her policies of privatisation, breaking the power of trade unions, and selling off public housing." -- World Is One News --
participants (3)
-
Andrei Borzenkov
-
Masaru Nomiya
-
mh@mike.franken.de