为什么 systemd 不断终止我的服务

fid*_*del 5 linux systemd

我想在达到 getty.target 后从 systemd 启动一个交互式脚本。到目前为止,这是有效的,但是,systemd 在几秒钟后杀死了脚本。systemd 单元如下所示:

\n\n
[Unit]\nDescription = Some interactive script\nRequires = getty@tty1.service\nAfter = getty@tty1.service\n\n[Service]\nType = oneshot\nExecStart = /usr/local/bin/my-script\nStandardInput = tty\nStandardOutput = tty\nTTYPath = /dev/tty1\nTTYReset = yes\nTTYVHangup = yes\n\n[Install]\nWantedBy = multi-user.target\n
Run Code Online (Sandbox Code Playgroud)\n\n

在脚本中,有对 等的调用dialogmount没有什么特别的,但它是一个交互式脚本。Systemd 不断杀死脚本,我不明白为什么。的输出systemctl status interactive-script.service看起来像:

\n\n
\xe2\x97\x8f interactive-script.service - Some interactive script\n   Loaded: loaded (/etc/systemd/system/interactive-script.service; enabled)\n   Active: inactive (dead) since Tue 2016-06-28 10:18:07 UTC; 14min ago\n Main PID: 364 (code=killed, signal=HUP)\n
Run Code Online (Sandbox Code Playgroud)\n\n

并且得到的日志输出journalctl -b -u interactive-script.service是空的:

\n\n
-- Logs begin at Mon 2015-11-09 11:49:52 UTC, end at Tue 2016-06-28 10:30:28 UTC. --\n
Run Code Online (Sandbox Code Playgroud)\n\n

我已经尝试添加KillMode=none,但没​​有成功。然后我尝试了TimeoutStartSec=infinity - systemd 抱怨它不理解它,因此我尝试将其设置为 10000,但脚本在几秒钟后就被终止了。我尝试以Type=simpleType=forking运行它,但都无济于事。

\n\n

关键是启动脚本似乎工作正常(出现对话框),但 systemd 不断终止脚本。我怎样才能实现 systemd不会杀死这个交互式脚本

\n