[systemd-devel] [PATCH v3] systemctl: add edit verb
Ronny Chevalier
chevalier.ronny at gmail.com
Wed Oct 22 09:28:24 PDT 2014
2014-10-22 11:15 GMT+02:00 Lennart Poettering <lennart at poettering.net>:
> On Wed, 22.10.14 01:48, Zbigniew Jędrzejewski-Szmek (zbyszek at in.waw.pl) wrote:
>
>> On Sat, Oct 18, 2014 at 06:30:02PM +0200, Ronny Chevalier wrote:
>> > It helps editing units by either creating a drop-in file, like
>> > /etc/systemd/system/my.service.d/amendments.conf, or by copying the
>> > original unit from /usr/lib/systemd/ to /etc/systemd/ if the --full
>> > option is specified. Then it invokes an editor to the related files
>> > and daemon-reload is invoked when the editor exited successfully.
>>
>> Hm, this sequence doesn't sound right. A temporary file should be
>> created, edited, and then atomically put in place, iff the editor
>> exits successfully. I think we should follow in the footsteps of git
>> here... and abort if the editor exits with an error.
>
> Hmm, don't smart editors do this anyway when saving a file?
Yes, but what Zbigniew meant, is that I mkdir_p and in the case of
--full I copy the file. So if the editor doesn't exit successfully, we
will not delete the dirs and files.
>
>> I'm not sure abou the name 'amendments.conf'. Wouldn't 'local.conf'
>> be more idiomatic, and also easier to type?
>
> I was thinking about this too, and I wanted to propose "override.conf"
> instead?
>
> The word "amendment" I only know from the US constitution...
Ok, both are fine for me.
>
> Lennart
>
> --
> Lennart Poettering, Red Hat
More information about the systemd-devel
mailing list