<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/poky.git/meta/classes-recipe/systemd.bbclass, branch walnascar</title>
<subtitle>Mirror of git.yoctoproject.org/poky</subtitle>
<id>https://git.enea.com/cgit/linux/poky.git/atom?h=walnascar</id>
<link rel='self' href='https://git.enea.com/cgit/linux/poky.git/atom?h=walnascar'/>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/'/>
<updated>2025-09-22T19:21:23+00:00</updated>
<entry>
<title>systemd.bbclass: Make systemd_postinst run as intended</title>
<updated>2025-09-22T19:21:23+00:00</updated>
<author>
<name>Peter Kjellerstedt</name>
<email>pkj@axis.com</email>
</author>
<published>2025-09-12T15:57:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=6338bb1d120246fb073acb43fad41c4ba262c8fc'/>
<id>urn:sha1:6338bb1d120246fb073acb43fad41c4ba262c8fc</id>
<content type='text'>
After the switch from using a systemctl written in Python to using the
official version of systemctl from the systemd project, the
systemd_postinst function has effectively not been executed during the
rootfs creation. The reason is that systemctl provided by
systemctl-native fails if run without arguments (as systemd_postinst
does):

  Failed to connect to system scope bus via local transport: Operation
  not permitted (consider using --machine=&lt;user&gt;@.host --user to connect
  to bus of other user)

This is not seen in the logs since stderr is sent to /dev/null, and the
only way to tell that there is a problem is because systemd services
that are expected to be enabled aren't running.

The reason this has gone unnoticed is because systemd_handle_machine_id
in rootfs-postcommands.bbclass will call systemctl preset-all, which in
most cases will create the missing links to enable the systemd services.

This change effectively reverts commit
a52e66762c0c51918b1ba3d4622759637b6e920a (systemd.bbclass: update
command to check systemctl available) and instead only runs systemctl
without arguments (to determine that it can communicate with systemd)
when executed on target.

(From OE-Core rev: 6cb4239b412dc782f66728e47753c1a82cccf759)

Signed-off-by: Peter Kjellerstedt &lt;peter.kjellerstedt@axis.com&gt;
Signed-off-by: Steve Sakoman &lt;steve@sakoman.com&gt;
</content>
</entry>
<entry>
<title>systemd.bbclass: generate preset for templates</title>
<updated>2025-06-13T16:01:26+00:00</updated>
<author>
<name>Patrick Williams</name>
<email>patrick@stwcx.xyz</email>
</author>
<published>2025-06-04T11:00:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=e5824127e46e927c7b24f576dbf6e603e85bc9c7'/>
<id>urn:sha1:e5824127e46e927c7b24f576dbf6e603e85bc9c7</id>
<content type='text'>
There was a regression introduced by the change to use
systemd-systemctl-native rather than a python fake implementation,
which caused template units to not be properly enabled when set in
the SYSTEMD_SERVICE variable.  Through investigation, it seems that
the best way to re-enable template instances is to handle them
explicitly in the systemd.bbclass and enable them with `preset`, like
most units are handled[1,2].

Per the systemd.preset manpage, the format for template units is
different than for regular units[3].  We need to coalesce all the
template instances onto a single line and emit them as an additional
space-deliminated argument.

Ran this against openbmc's phosphor-ipmi-net recipe and generated
the following preset file:
```
$ cat packages-split/phosphor-ipmi-net/usr/lib/systemd/system-preset/98-phosphor-ipmi-net.preset
enable phosphor-ipmi-net@.service eth0
enable phosphor-ipmi-net@.socket eth0
```

[1]: https://lore.kernel.org/openembedded-core/Z2ch.1747051947055246176.oktf@lists.openembedded.org/
[2]: https://lore.kernel.org/openembedded-core/aDdoTVtCmElpURYD@heinlein/
[3]: https://www.freedesktop.org/software/systemd/man/latest/systemd.preset.html

Fixes: 7a580800db39 ("systemd: Build the systemctl executable")
(From OE-Core rev: f33d9b1f434e40a459614d8dc21ce45e11581008)

(From OE-Core rev: ea207dce1f5f8579d8ddde487ac9852f50bfc792)

Signed-off-by: Patrick Williams &lt;patrick@stwcx.xyz&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
Signed-off-by: Steve Sakoman &lt;steve@sakoman.com&gt;
</content>
</entry>
<entry>
<title>systemd.bbclass: support user units in postinst and prerm hooks</title>
<updated>2025-01-21T12:07:56+00:00</updated>
<author>
<name>Artur Kowalski</name>
<email>arturkow2000@gmail.com</email>
</author>
<published>2025-01-20T12:46:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=2ff2277ba3e08f4d486f20e3565c9c43d1e239a1'/>
<id>urn:sha1:2ff2277ba3e08f4d486f20e3565c9c43d1e239a1</id>
<content type='text'>
Handle user units in a manner similar to system units where possible.
Not everything is supported by systemd, but systemd limitations only
affect runtime package management - during update user services are not
reloaded/restart and each user must re-login or manually restart
services.

(From OE-Core rev: ce62b88d8f71368e356b6409ada46a34a6017ddf)

Signed-off-by: Artur Kowalski &lt;arturkow2000@gmail.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>systemd.bbclass: update postinst and prerm hooks</title>
<updated>2025-01-21T12:07:56+00:00</updated>
<author>
<name>Artur Kowalski</name>
<email>arturkow2000@gmail.com</email>
</author>
<published>2025-01-20T12:46:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=db861568758e91e0634bd1e267157e00da842468'/>
<id>urn:sha1:db861568758e91e0634bd1e267157e00da842468</id>
<content type='text'>
Since SYSTEMD_SERVICE_ESCAPED may contain both system and user services
we need to filter out user services in call to systemctl. Introduce
helper systemd_filter_services() which takes space-separated list of
services and returns services of requested type.

(From OE-Core rev: ec548b274d56b2c7a2663b70200df95a49e7452c)

Signed-off-by: Artur Kowalski &lt;arturkow2000@gmail.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>systemd.bbclass: properly handle user units in systemd_create_presets</title>
<updated>2025-01-21T12:07:56+00:00</updated>
<author>
<name>Artur Kowalski</name>
<email>arturkow2000@gmail.com</email>
</author>
<published>2025-01-20T12:46:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=284450ed971fc34085824b4c51f879d4f8cfac2d'/>
<id>urn:sha1:284450ed971fc34085824b4c51f879d4f8cfac2d</id>
<content type='text'>
Previously user units were handled the same way as system units, that
is all preset files were created in system-preset directory, but user
presets should be in user-preset directory.

(From OE-Core rev: 0218542d80723ec314a648af8e9649806c3a51aa)

Signed-off-by: Artur Kowalski &lt;arturkow2000@gmail.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>systemd.bbclass: introduce systemd_service_searchpaths()</title>
<updated>2025-01-21T12:07:56+00:00</updated>
<author>
<name>Artur Kowalski</name>
<email>arturkow2000@gmail.com</email>
</author>
<published>2025-01-20T12:46:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=a3302b821600119b3e346ed10f0ffa3c3533e77c'/>
<id>urn:sha1:a3302b821600119b3e346ed10f0ffa3c3533e77c</id>
<content type='text'>
systemd_service_searchpaths accepts boolean value indicating whether we
are dealing with system or user units and returns search paths
accordingly.

Previously search path list was created in systemd_check_services() but
following commits will introduce additional places. The
systemd_service_searchpaths helper function is meant to reduce code
duplication.

(From OE-Core rev: 9a89d36932dda306b3c2cf10771647eabc267769)

Signed-off-by: Artur Kowalski &lt;arturkow2000@gmail.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>systemd.bbclass: factor out service lookup logic into separate function</title>
<updated>2025-01-21T12:07:56+00:00</updated>
<author>
<name>Artur Kowalski</name>
<email>arturkow2000@gmail.com</email>
</author>
<published>2025-01-20T12:46:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=8c5a6ca6f991c65eac1d6b4235fddc6e99778501'/>
<id>urn:sha1:8c5a6ca6f991c65eac1d6b4235fddc6e99778501</id>
<content type='text'>
Factor out the logic into systemd_service_path(). This will be needed by
following commits to avoid code duplication.

(From OE-Core rev: d383e18138050490f3dcb95377f63a2a31c3149f)

Signed-off-by: Artur Kowalski &lt;arturkow2000@gmail.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>systemd.bbclass: add ${sysconfdir}/systemd/user to search path</title>
<updated>2025-01-21T12:07:56+00:00</updated>
<author>
<name>Artur Kowalski</name>
<email>arturkow2000@gmail.com</email>
</author>
<published>2025-01-20T12:46:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=7ed8900926baf35e2da1d3170e435d2c6c612b63'/>
<id>urn:sha1:7ed8900926baf35e2da1d3170e435d2c6c612b63</id>
<content type='text'>
We already search for system units ${sysconfdir}/systemd/system but we
don't search for user units in corresponding directory under ${sysconfdir}.
Keep the behaviour consistent so that both unit types are searched in
${systemd_{system,user}_unitdir} and ${sysconfdir}/systemd/{system,user}.

(From OE-Core rev: df1cdf1bf4cd7d9f17c6a02538057ccfc2efba64)

Signed-off-by: Artur Kowalski &lt;arturkow2000@gmail.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>systemd.bbclass: do not automatically add Also services</title>
<updated>2024-12-17T11:41:52+00:00</updated>
<author>
<name>Adrian Freihofer</name>
<email>adrian.freihofer@siemens.com</email>
</author>
<published>2024-12-12T15:55:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=efa5f65c2214239ed7aaf7bd8998683e755c5660'/>
<id>urn:sha1:efa5f65c2214239ed7aaf7bd8998683e755c5660</id>
<content type='text'>
Starting a systemd service “Also” does not mean that both services
must be in the same package. However, the systemd.bbclass enforces
this.

Example:
  a.service:
    [Install]
    Also=b.service
If a.service is packed in package A, b.service is automatically packed
into package A as well. This happens even if b.service is explicitly
added to package B using FILES and SYSTEMD_SERVICE variables.

The automatic packing of socket files with the corresponding service
files is probably a widely used feature of systemd.bbclass. This bahavior
does not change.

Adding regular service files to a package just because it is another
service in the same package that "Also" uses the service is a bug that
this commit fixes.

(From OE-Core rev: f836d80eb48a2a2f9b1e66980021755cf0ca2a26)

Signed-off-by: Adrian Freihofer &lt;adrian.freihofer@siemens.com&gt;
Signed-off-by: Mathieu Dubois-Briand &lt;mathieu.dubois-briand@bootlin.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>systemd.bbclass: refactor adding files</title>
<updated>2024-12-17T11:41:52+00:00</updated>
<author>
<name>Adrian Freihofer</name>
<email>adrian.freihofer@siemens.com</email>
</author>
<published>2024-12-12T15:55:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.enea.com/cgit/linux/poky.git/commit/?id=0324f6974964b9bc32726e9cbb5b718d90c78503'/>
<id>urn:sha1:0324f6974964b9bc32726e9cbb5b718d90c78503</id>
<content type='text'>
The keys variable was intended as an array of keys. But it looks like
this has not been used for more than 10 years now. Adding files
automatically to packages needs probably anyway very specific code
rather than a generic loop. Lets simplify this a bit.
Using python code should also not be slower for these usually small
files.

(From OE-Core rev: 0eda7131bf743719d6586ccd36d99cbe11c88262)

Signed-off-by: Adrian Freihofer &lt;adrian.freihofer@siemens.com&gt;
Signed-off-by: Mathieu Dubois-Briand &lt;mathieu.dubois-briand@bootlin.com&gt;
Signed-off-by: Richard Purdie &lt;richard.purdie@linuxfoundation.org&gt;
</content>
</entry>
</feed>
