SELinux on Fedora: rkt started as systemd service: execv() failed: No such file or directory #2322
Comments
It only happens when rkt is executed in a systemd service and SELinux is enabled. |
To reproduce the issue, I used:
The message "No such file or directory" was misleading: strace reveals that there was EACCESS errors before:
The SELinux errors are:
|
/cc @rhatdan Do you have an idea about this SELinux issue ^ when rkt is started via systemd-run? |
I tried with a .service file with the "SELinuxContext" option:
And it made it work. Should we recommend this in the documentation? |
Filed systemd/systemd#2896 to request a SELinuxContext parameter in systemd-run. |
Great monologue :) |
We actually need to work on the policy. The problem here is we need to add a transiton from initrc_t to svirt_lxc_net_t. |
Now compile this te file and install it. You need to have selinux-policy-devel
Now you should be able to run the rkt container without the unconfined_t line. |
@rhatdan thanks, it works fine with your |
There are other SELinux issues but I will file them as separate issues as they are found. |
@alban Seems like we don't need to wait for #2361 to support selinux options in kubernetes/kubernetes#23773 We can just use the |
@yifan-gu sure, Kubernetes can use SELinuxContext=. Kubernetes writes the service file itself and does not use systemd-run, does it? I am asking because of systemd/systemd#2896 |
@alban Yes, it is writing the service file to disk today |
@alban What is the SELinuxContext I need to set to make rkt run as unit on fedora? I keep getting permission denied even if I don't specify any selinux context. But I can run manually through cmd line. |
Needs to figure out which version of Fedora has the fix: fedora-selinux/selinux-policy#114 (comment) |
@alban I tried with no-overlay and the context you mentioned in #2322 (comment) |
Moving milestone, since this is tracking an external target (whether the fix is in all versions of Fedora). |
After #2308 was merged, I ran the tests on Fedora Rawhide with
tests/aws.sh
with thehost
flavor. A lot of tests fail with "execv() failed" but it is not always reproducible:The text was updated successfully, but these errors were encountered: