Skip to contentSkip to conversation

lxc: delete empty lxc state directory

PATCH In review Vishwas Udupa 2 participants 4 messages Dec 4, 2025 – Jan 6

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 lxc: delete empty lxc state directory

lxc systemd service [1] defines a StateDirectory to ensure that the /var/lib/lxc directory is automatically created and managed by systemd during service startup.
Do not create lxc directory at build time for systemd.

[1] https://github.com/lxc/lxc/blob/f9ff9ea2a92653a823edf25e8e28c9dab08b3090/config/init/systemd/lxc.service.in#L16

---
 recipes-containers/lxc/lxc_git.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
recipes-containers/lxc/lxc_git.bb +1 -1
index d6f137d3..542134db 100644
@@ -141,7 +141,7 @@ do_install:append() {
 
 	if "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}"; then
 	    # nothing special for systemd at the moment
-	    true
+	    (cd ${D}${localstatedir}; [ -d lib/lxc ] && rmdir -v --parents lib/lxc)
 	else
 	    # with meson, these aren't built unless sysvinit is the enabled
 	    # init system.
Signature · 1 line
2.25.1
#1 lore raw

Is there any feedback on this patch?
Could you please merge this.

regards,
Vishwas

________________________________
From: Vishwas Udupa <[email protected]>
Sent: Thursday, December 04, 2025 12:13 PM
To: [email protected] <[email protected]>
Cc: [email protected] <[email protected]>; Vishwas Udupa <[email protected]>
Subject: [PATCH v2] lxc: delete empty lxc state directory

lxc systemd service [1] defines a StateDirectory to ensure that the /var/lib/lxc directory is automatically created and managed by systemd during service startup.
Do not create lxc directory at build time for systemd.

[1] https://github.com/lxc/lxc/blob/f9ff9ea2a92653a823edf25e8e28c9dab08b3090/config/init/systemd/lxc.service.in#L16

---
 recipes-containers/lxc/lxc_git.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
recipes-containers/lxc/lxc_git.bb +1 -1
index d6f137d3..542134db 100644
@@ -141,7 +141,7 @@ do_install:append() {
 
         if "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}"; then
             # nothing special for systemd at the moment
-           true
+           (cd ${D}${localstatedir}; [ -d lib/lxc ] && rmdir -v --parents lib/lxc)
         else
             # with meson, these aren't built unless sysvinit is the enabled
             # init system.

--
2.25.1

#2 lore raw
Quoted 2 lines · Vishwas Udupa via lists.yoctoproject.org

Is there any feedback on this patch?

Not yet, or you would have gotten an email ;)

Quoted 1 line

Could you please merge this.

This part of the message is not needed, it comes across not as a question, but a demand.

I'm working on some final release items (and had to get the 6.18 kernel into OEcore). I expect to have them done in the next few days.

After that work is done, I'll return to the queue and finish pending reviews and merges

Cheers,

Bruce

Quoted 48 lines

regards,
Vishwas

________________________________
From: Vishwas Udupa <[email protected]>
Sent: Thursday, December 04, 2025 12:13 PM
To: [email protected] <[email protected]>
Cc: [email protected] <[email protected]>; Vishwas Udupa <[email protected]>
Subject: [PATCH v2] lxc: delete empty lxc state directory

lxc systemd service [1] defines a StateDirectory to ensure that the /var/lib/lxc directory is automatically created and managed by systemd during service startup.
Do not create lxc directory at build time for systemd.

[1] https://github.com/lxc/lxc/blob/f9ff9ea2a92653a823edf25e8e28c9dab08b3090/config/init/systemd/lxc.service.in#L16

---
 recipes-containers/lxc/lxc_git.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
recipes-containers/lxc/lxc_git.bb +1 -2
index d6f137d3..542134db 100644
@@ -141,7 +141,7 @@ do_install:append() {
 
         if "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}"; then
             # nothing special for systemd at the moment
-           true
+           (cd ${D}${localstatedir}; [ -d lib/lxc ] && rmdir -v --parents lib/lxc)
         else
             # with meson, these aren't built unless sysvinit is the enabled
             # init system.
--

2.25.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#9496): https://lists.yoctoproject.org/g/meta-virtualization/message/9496
Mute This Topic: https://lists.yoctoproject.org/mt/116608759/1050810
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-virtualization/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Signature · 3 lines
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II
#3 lore raw
In reply to Vishwas Udupa

merged.

Bruce

In message: [meta-virtualization] [PATCH v2] lxc: delete empty lxc state directory

Quoted 38 lines · on 04/12/2025 Vishwas Udupa via lists.yoctoproject.org wrote:

lxc systemd service [1] defines a StateDirectory to ensure that the /var/lib/lxc directory is automatically created and managed by systemd during service startup.
Do not create lxc directory at build time for systemd.

[1] https://github.com/lxc/lxc/blob/f9ff9ea2a92653a823edf25e8e28c9dab08b3090/config/init/systemd/lxc.service.in#L16

---
 recipes-containers/lxc/lxc_git.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
recipes-containers/lxc/lxc_git.bb +1 -1
index d6f137d3..542134db 100644
@@ -141,7 +141,7 @@ do_install:append() {
 
 	if "${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}"; then
 	    # nothing special for systemd at the moment
-	    true
+	    (cd ${D}${localstatedir}; [ -d lib/lxc ] && rmdir -v --parents lib/lxc)
 	else
 	    # with meson, these aren't built unless sysvinit is the enabled
 	    # init system.
Signature · 11 lines
2.25.1



-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#9477): https://lists.yoctoproject.org/g/meta-virtualization/message/9477
Mute This Topic: https://lists.yoctoproject.org/mt/116608759/1050810
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-virtualization/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-