Bug 65733 - RFE: Appending to unit file directives
Summary: RFE: Appending to unit file directives
Status: RESOLVED FIXED
Alias: None
Product: systemd
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: systemd-bugs
QA Contact: systemd-bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-13 20:38 UTC by Michael Stapelberg
Modified: 2019-08-22 10:37 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Michael Stapelberg 2013-06-13 20:38:03 UTC
With the .include mechanism, I can overwrite or delete the contents of a directive, e.g.:

.include /lib/systemd/system/codesearch.service
ExecStart=/usr/bin/codesearch -verbose

What I cannot do currently is extending the old value, e.g.:

.include /lib/systemd/system/codesearch.service
ExecStart=$ExecStart -verbose

This would be helpful (and at least two other people on #systemd also wished for it when I asked).

Lennart (et al), is that something you’d accept? If so, how precisely should it work? I.e. how should one refer to the old value? A format string value? A pseudo-variable? A prefix of some sort?

Let me know and I’ll be happy to provide a patch.
Comment 1 Lennart Poettering 2013-09-12 18:10:13 UTC
So, humm. not sure.

This isn't that easy I fear, as ExecStart= may be used multiple times in Type=oneshot units, and which one would you replace then?

Also, I can see the ebenfit of extending command lines, but I wouldn't want to make this too flexible, so the only thing that would be OK I think would be to allow a syntax like ExecStart+= or ExecStart=+ to append to the end...

But still, I don't see how the multiple ExecStart= assignment issue could be dealt with. Ideas?
Comment 2 Michael Stapelberg 2013-09-14 00:48:44 UTC
(In reply to comment #1)
> So, humm. not sure.
> 
> This isn't that easy I fear, as ExecStart= may be used multiple times in
> Type=oneshot units, and which one would you replace then?
> [...]
> But still, I don't see how the multiple ExecStart= assignment issue could be
> dealt with. Ideas?
Can we simply make this fail when there is more than one ExecStart= directive, given that there is no good way of handling that situation anyway?
Comment 3 Zbigniew Jedrzejewski-Szmek 2019-08-22 10:37:39 UTC
Some time has passed... We are not going to add a mechanism to extend existing lines. Where this makes sense, we generally allow lists to be extended with new items.

> Can we simply make this fail when there is more than one ExecStart= directive, given that there is no good way of handling that situation anyway?

This is implemented since ages.

Let's close.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.