如何将systemd中的StandardOutput重定向到屏幕

问题描述 投票:0回答:1

我正在尝试将ExecStartPre运行的脚本的输出重定向到屏幕。

我知道我需要在service`s文件中使用standardOutput,但是当我测试它们时,这些选项没有用(journal + console,tty)。我使用了journal + console,输出只保存在日志中。我也试过tty,但我没有得到输出。

[Service]
Type=notify
StandartOutput=tty
ExecStartPre=somescript
ExecStartPre=someotherscript
ExecStart=somescript
ExecReload=/bin/kill -HUP $MAINPID
KillMode=mixed
KillSignal=SIGINT
centos7 systemd
1个回答
0
投票

检查你的拼写。它是StandardOutput,而不是StandartOutput。

© www.soinside.com 2019 - 2024. All rights reserved.