![systemd:无法附加到 cgroup...没有这样的文件或目录](https://linux22.com/image/231223/systemd%EF%BC%9A%E6%97%A0%E6%B3%95%E9%99%84%E5%8A%A0%E5%88%B0%20cgroup...%E6%B2%A1%E6%9C%89%E8%BF%99%E6%A0%B7%E7%9A%84%E6%96%87%E4%BB%B6%E6%88%96%E7%9B%AE%E5%BD%95.png)
操作系统 Ubuntu-22.04
内核版本 6.2.0-39-generic
systemd --版本 systemd 249 (249.11-0ubuntu3.12)
问题描述:从一个 perl 脚本中,我尝试停止和启动myservice
,该脚本没有任何更改,并且在 systemd 237 / ubuntu 18.04 机器上运行良好。
该脚本中的命令是...
/bin/systemctl stop myservice.service
/bin/systemctl start myservice.service
该脚本能够成功停止服务,但无法成功启动它,并且看到以下错误消息。
Apr 26 08:18:27 myhost systemd[11189]: ovt-myservice.service: Failed to attach to cgroup /system.slice/system-ovt\x2dmyservice.slice/ovt-myservice.service: No such file or directory
Apr 26 08:18:27 myhost systemd[11189]: ovt-myservice.service: Failed at step CGROUP spawning /usr/share/fold/systemd/ovt-myservice.sh: No such file or directory
Apr 26 08:18:27 myhost systemd[1]: ovt-myservice.service: Control process exited, code=exited, status=219/CGROUP