<html>
<head>
<base href="https://bugs.freedesktop.org/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Priority</th>
<td>medium
</td>
</tr>
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - Add support for custom sections and settings in unit files"
href="https://bugs.freedesktop.org/show_bug.cgi?id=82724">82724</a>
</td>
</tr>
<tr>
<th>Assignee</th>
<td>systemd-bugs@lists.freedesktop.org
</td>
</tr>
<tr>
<th>Summary</th>
<td>Add support for custom sections and settings in unit files
</td>
</tr>
<tr>
<th>QA Contact</th>
<td>systemd-bugs@lists.freedesktop.org
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux (All)
</td>
</tr>
<tr>
<th>Reporter</th>
<td>szigeti.marton.levente@t-online.hu
</td>
</tr>
<tr>
<th>Hardware</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Component</th>
<td>general
</td>
</tr>
<tr>
<th>Product</th>
<td>systemd
</td>
</tr></table>
<p>
<div>
<pre>Currently systemd discards unknown sections in unit files with a message logged
about doing so. Addig custom section support (for example, by prefixing the
section name with a *) and making these available on D-Bus would open many
possibilities: units could be augmented with data for non-systemd applications
and would be completely in sync with systemd and wouldn't require parsing unit
files by applications.
A few possible use cases:
* Creating a monitd-like monitoring application with its tests defined with the
services they are supposed to check
* CoreOS's Fleet currently does this with X-Fleet sections
* And many more I can't think of :)
As an example:
/etc/systemd/system/freeradius.service:
.include /usr/lib/systemd/system/freeradius.service
[*Test1]
Name=Test with good credentials
Exec=/usr/local/test-freeradius.sh
[*Test2]
Name=Test with good credentials using expect script
ExpectCmd=/usr/local/test-freeradius.exp
--
And the org.freedesktop.systemd1.Unit interface could have a CustomSections
property (an array of section names) and a GetCustomProperty(String
SectionName, String PropertyName) method:
/org/freedesktop/systemd1/unit/freeradius_2eservice
CustomSections = ["Test1","Test2"]
GetCustomProperty("Test1", "Name") -> "Test with good credentials using expect
script"</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the QA Contact for the bug.</li>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>