Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add check for ReadWritePaths -- exists at SytemD only after version 231 #627

Closed
0bi-w6n-K3nobi opened this issue Apr 22, 2022 · 1 comment · Fixed by #628
Closed

Add check for ReadWritePaths -- exists at SytemD only after version 231 #627

0bi-w6n-K3nobi opened this issue Apr 22, 2022 · 1 comment · Fixed by #628

Comments

@0bi-w6n-K3nobi
Copy link

0bi-w6n-K3nobi commented Apr 22, 2022

I just create a new installation for CentOS 7 at LXC container [not LXD].
After running, I found several warning messages with this format:

[/run/systemd/.../.../zzz-lxc-service.conf:6] Unknown lvalue 'ReadWritePaths' in section 'Service'

I did check at Git source from SystemD, and found at NEWS file, that statement ReadWritePaths exist only after version 231.
I rechecked at versions, and get the same conclusion.
Well, ... CentOS 7 has SystemD 219.

Hummm... Looking at DistroBuilder sources, I think just apply the follow patch that will be solve:

--- a/distrobuilder/main.go     2022-04-21 08:38:08.000000000 +0000
+++ b/distrobuilder/main.go     2022-04-22 16:59:30.073944330 +0000
@@ -658,7 +658,7 @@
                        echo "PrivateTmp=no";
                        [ "${systemd_version}" -ge 244 ] && echo "ProtectKernelLogs=no";
                        [ "${systemd_version}" -ge 232 ] && echo "ProtectKernelModules=no";
-                       echo "ReadWritePaths=";
+                       [ "${systemd_version}" -ge 231 ] && echo "ReadWritePaths=";
                fi
        } > "${dropin_dir}/zzz-lxc-service.conf"
 }

I hope I may have helped.

simondeziel added a commit to simondeziel/distrobuilder that referenced this issue Apr 22, 2022
Closes lxc#627

Signed-off-by: Simon Deziel <simon.deziel@canonical.com>
@0bi-w6n-K3nobi
Copy link
Author

0bi-w6n-K3nobi commented Apr 22, 2022

PS:

Well... yet I had problem after apply this patch.
This is will produce the following error after first zzz-lxc-service.conf generated:

/etc/systemd/system-generators/lxc failed with error code 1.

I did try debug, but simply can't get found why.
If you have idea about this you be free to get another solution.
Therefore, for solve I included the echo ""; not important line, then the final patch will be:

--- a/distrobuilder/main.go     2022-04-21 08:38:08.000000000 +0000
+++ b/distrobuilder/main.go     2022-04-22 16:59:30.073944330 +0000
@@ -658,7 +658,8 @@
                        echo "PrivateTmp=no";
                        [ "${systemd_version}" -ge 244 ] && echo "ProtectKernelLogs=no";
                        [ "${systemd_version}" -ge 232 ] && echo "ProtectKernelModules=no";
-                       echo "ReadWritePaths=";
+                       [ "${systemd_version}" -ge 231 ] && echo "ReadWritePaths=";
+                       echo "";
                fi
        } > "${dropin_dir}/zzz-lxc-service.conf"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant