Skip to content

Commit 1d176cd

Browse files
opt[orion]: Add validation to check whether the buck2 program exists. (#2081)
Signed-off-by: Luxian <lux1an@qq.com>
1 parent e28df26 commit 1d176cd

2 files changed

Lines changed: 13 additions & 8 deletions

File tree

orion/runner-config/preflight.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,15 @@ if (( (16#${CAP_EFF_HEX} & CAP_SYS_ADMIN_MASK) == 0 )); then
3434
exit 1
3535
fi
3636

37+
echo "==> [预检] 检查 buck2 ..."
38+
if ! command -v buck2 >/dev/null 2>&1; then
39+
echo "错误:buck2 不在 PATH 中,请安装 buck2 到 /usr/local/bin/buck2。"
40+
exit 1
41+
fi
42+
if ! buck2 version >/dev/null 2>&1; then
43+
echo "错误:buck2 已安装但无法执行(权限或依赖问题)。"
44+
exit 1
45+
fi
46+
echo " - buck2 就绪: $(which buck2)"
47+
3748
echo "==> [预检] 通过"

orion/systemd/orion-runner.service

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,8 @@ KillSignal=SIGTERM
3535
SendSIGKILL=yes
3636
FinalKillSignal=SIGKILL
3737

38-
# Grant capabilities for FUSE mounting and read-search bypass
39-
AmbientCapabilities=CAP_SYS_ADMIN
40-
CapabilityBoundingSet=CAP_SYS_ADMIN CAP_DAC_OVERRIDE CAP_DAC_READ_SEARCH
41-
42-
# Basic hardening (relaxed for FUSE operations)
43-
NoNewPrivileges=false
44-
PrivateTmp=false
45-
PrivateMounts=no
38+
LimitNOFILE=10485760
39+
LimitNPROC=1048576
4640

4741
[Install]
4842
WantedBy=multi-user.target

0 commit comments

Comments
 (0)