操作系统 Ubuntu-22.04
内核版本 6.2.0-39-通用
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