我尝试了类似的东西
[Unit]
Description=top on console
[Service]
ExecStart=/usr/bin/top
StandardOutput=tty
TTYPath=/dev/ttyS0
[Install]
WantedBy=multi-user.target
但是没有运气。还有一些其他未解决的问题https://stackoverflow.com/questions/48094018/how-to-redirect-script-output-to-the-stdout-of-systemd
上面的内容也为我工作(系统版本231),方法是添加
StandardInput=tty
因为否则top
拒绝运行失败的tty get。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句