如何解决树莓派上的 Rust 可执行文件无法读取 oom_kill
我用目标架构 armv7-unknown-linux-gnueabihf
编译了一个 Rust 程序,以在具有系统架构的 raspberry pi 3 上安装和运行它:
Linux ubuntu 5.11.0-1009-raspi #10-Ubuntu SMP PREEMPT Fri May 14 14:49:24 UTC 2021 aarch64 aarch64 aarch64 GNU/Linux
。
如果我尝试通过 bash ($ <executable>
) 启动它,它启动时不会出错。
但是,当尝试通过如下所示的 systemd 服务启动它时:
[Unit]
Description=Client
After=multi-user.target
[Service]
ExecStart=<path-to-exec>
Restart=always
RestartSec=10s
[Install]
WantedBy=multi-user.target
我收到以下错误(通过 systemctl status <service>
):
Aug 01 11:36:24 ubuntu systemd[1]: service: Job 19631607 service/start finished,result=done
Aug 01 11:36:24 ubuntu systemd[1]: Started Client.
Aug 01 11:36:24 ubuntu systemd[1]: service: Failed to read oom_kill field of memory.events cgroup attribute: No such file or directory
Aug 01 11:36:24 ubuntu systemd[1]: service: Child 874846 belongs to service.
Aug 01 11:36:24 ubuntu systemd[1]: service: Main process exited,code=exited,status=203/EXEC
Aug 01 11:36:24 ubuntu systemd[1]: service: Failed with result 'exit-code'.
Aug 01 11:36:24 ubuntu systemd[1]: service: Service will restart (restart setting)
Aug 01 11:36:24 ubuntu systemd[1]: service: Changed running -> failed
Aug 01 11:36:24 ubuntu systemd[1]: service: Unit entered failed state.
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。