Commit 3c1b583
Fix SELinux denials on SSH fleet provisioning (#3702)
On SELinux-enforcing hosts (RHEL, Rocky), files moved from /tmp retain
their original SELinux context. systemd (init_t) cannot read files with
user_tmp_t or unconfined_u context, causing the shim service to fail.
Fix by adding chcon after mv to set correct SELinux contexts for the
service file (systemd_unit_file_t) and env file (etc_t). The chcon
is a no-op on non-SELinux systems via 2>/dev/null || true.
Also replace mv with cp+rm for the shim binary download to ensure
correct context in /usr/local/bin/.
Co-authored-by: Andrey Cheptsov <andrey.cheptsov@github.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 77f3be1 commit 3c1b583
File tree
2 files changed
+7
-2
lines changed- src/dstack/_internal
- core/backends/base
- server/services/ssh_fleets
2 files changed
+7
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
906 | 906 | | |
907 | 907 | | |
908 | 908 | | |
909 | | - | |
| 909 | + | |
910 | 910 | | |
911 | 911 | | |
912 | 912 | | |
| |||
Lines changed: 6 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | | - | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
77 | 81 | | |
78 | 82 | | |
79 | 83 | | |
| |||
148 | 152 | | |
149 | 153 | | |
150 | 154 | | |
| 155 | + | |
151 | 156 | | |
152 | 157 | | |
153 | 158 | | |
| |||
0 commit comments