Bug 65733 - RFE: Appending to unit file directives
Summary: RFE: Appending to unit file directives
Status: NEW
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: 2013-09-14 00:48 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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?


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.