我们使用 chrome 远程桌面对 ubuntu 进行远程访问,但是我无法启用超过 32 个用户(每个用户都是一个 systemctl 单元,在加载到 32 个单元后,我无法启动其他单元)。
要列出已加载的单元,请使用以下命令:
sudo systemctl reset-failed && sudo systemctl list-units 'chrome-remote*'
要激活该单元,我使用以下命令
sudo systemctl stop chrome-remote-desktop@<user>.service
sudo systemctl status [email protected]
● [email protected] - Chrome Remote Desktop instance for user
Loaded: loaded (/etc/systemd/system/[email protected]; enabled; vendor preset: enabled)
Active: inactive (dead) since Fri 2023-03-10 04:48:04 -03; 4min 5s ago
Process: 58249 ExecStart=/opt/google/chrome-remote-desktop/chrome-remote-desktop --start --new-session (code=exited, status=1/FAILURE)
Main PID: 58249 (code=exited, status=1/FAILURE)
sudo journalctl -u chrome-remote-desktop@<user>.service
mar 10 04:28:35 <host_name> chrome-remote-desktop[8639]: Invalid MIT-MAGIC-COOKIE-1 keyxdpyinfo: unable to open display ":25".
mar 10 04:28:36 <host_name> chrome-remote-desktop[8671]: Invalid MIT-MAGIC-COOKIE-1 keyxdpyinfo: unable to open display ":25".
mar 10 04:34:10 <host_name> chrome-remote-desktop[46517]: Killing process 31788
mar 10 04:35:23 <host_name> chrome-remote-desktop[49840]: Invalid MIT-MAGIC-COOKIE-1 keyxdpyinfo: unable to open display ":50".
mar 10 04:35:24 <host_name> chrome-remote-desktop[49841]: Invalid MIT-MAGIC-COOKIE-1 keyxdpyinfo: unable to open display ":50".
mar 10 04:35:24 <host_name> chrome-remote-desktop[49847]: Invalid MIT-MAGIC-COOKIE-1 keyxdpyinfo: unable to open display ":50".
如何通过使所有服务保持“活动”和“运行”状态来增加“加载的单位数”?
最好的
答案1
是的,systemd 默认一次可加载的单元数限制为 32 个,您可以通过修改DefaultTasksMax
systemd 配置文件中的设置来解决这个问题。
去/etc/systemd/system.conf
搜索DefaultTasksMax
并把它放到无穷大DefaultTasksMax=infinity
然后重新加载 systemctlsudo systemctl daemon-reload
它应该可以工作