我正在尝试在工作中的 Debian buster 上使用 rudder-server,webapp 工作正常,但其中一个方向舵服务不起作用,我无法接收来自其他节点的报告:
● rudder-relayd.service - Rudder Relay Daemon
Loaded: loaded (/usr/lib/systemd/system/rudder-relayd.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2021-05-19 09:21:32 CEST; 1min 28s ago
Process: 32493 ExecStart=/opt/rudder/bin/rudder-relayd (code=exited, status=226/NAMESPACE)
Main PID: 32493 (code=exited, status=226/NAMESPACE)
May 19 09:21:32 rudder-v3 systemd[1]: Started Rudder Relay Daemon.
May 19 09:21:32 rudder-v3 systemd[32493]: rudder-relayd.service: Failed to set up mount namespacing: Permission denied
May 19 09:21:32 rudder-v3 systemd[32493]: rudder-relayd.service: Failed at step NAMESPACE spawning /opt/rudder/bin/rudder-relayd: Permission denied
May 19 09:21:32 rudder-v3 systemd[1]: rudder-relayd.service: Main process exited, code=exited, status=226/NAMESPACE
May 19 09:21:32 rudder-v3 systemd[1]: rudder-relayd.service: Failed with result 'exit-code'.
我的 Debian buster 是 Proxmox 服务器上的一个容器(不是无特权的容器),一切都是最新的,我已经更改了服务的配置但没有成功:
# vi /usr/lib/systemd/system/rudder-relayd.service
[Unit]
Description=Rudder Relay Daemon
After=network-online.target
[Service]
PrivateTmp=false
NoNewPrivileges=yes
PrivateDevices=false
ProtectControlGroups=false
ProtectKernelModules=false
ProtectSystem=false
ReadWritePaths=/var/rudder/reports /var/rudder/inventories /var/rudder/shared-files /var/rudder/cfengine-community/state
ExecStart=/opt/rudder/bin/rudder-relayd
ExecReload=/opt/rudder/bin/rudder relay reload
# Do not restart on known errors, which won't get fixed by themselves
RestartPreventExitStatus=2 3
User=rudder-relayd
Group=rudder
[Install]
RequiredBy=rudder-server.service
WantedBy=multi-user.target
当我执行“/opt/rudder/bin/rudder-relayd”时,我没有任何错误:
INFO relayd: Starting rudder-relayd 6.2.7
INFO relayd: Read configuration from "/opt/rudder/etc/relayd/"
INFO relayd::data::node: Parsing nodes list from "/var/rudder/lib/relay/nodeslist.json"
INFO relayd::api: Starting API on 127.0.0.1:3030
INFO relayd::input::watch: Starting file watcher on "/var/rudder/reports/incoming"
INFO relayd: Skipping inventory as it is disabled
INFO relayd: Server started
目录的权限是:
# ls -al /opt/rudder/bin/
[..]
-rwxr-xr-x 1 root root 8429816 Nov 22 2017 rudder-relayd
[..]
所有其他方向舵服务都可以正常工作,我什至可以使用我的管理员帐户访问方向舵界面。我已经能够接受待处理的节点,但似乎如果 rudder-relayd 服务关闭,我将无法收到合规报告,并且出现以下消息:
Error occured when contacting internal remote-run API to apply classes on Node 'root': (HTTP code 503)
我的测试的简要总结:
- 更改 rudder-relayd.service 配置,仅添加“ PrivateTmp=false\NoNewPrivileges=yes ”行;
- 不直接更改服务文件配置,而是使用systemctl edit rudder-relayd.service覆盖它
- 每次更改此文件后,我都会使用"systemctl daemon-reload" 重新加载守护进程;
- 在具有相同选项的另一个容器上安装 Rudder(仍然是相同的错误),在非特权容器上安装 rudder(此错误停止但出现其他错误,我不希望这成为解决方案);
谢谢