systemd oneshot 服务用于阻止用户登录提示

systemd oneshot 服务用于阻止用户登录提示

我有一个一次性的 systemd 服务,需要启动一个进程,但我不希望用户在其完成之前出现登录提示,尝试过这个:

[Unit]
Description=Stap Loader.
After=network-online.target
Before=systemd-logind.service

[Service]
Type=oneshot
LimitNOFILE=8192
ExecStart=/opt/stap/stap start
ExecStop=/opt/stap/stap stop
StandardOutput=journal+console
RemainAfterExit=yes
TTYVTDisallocate=true
TTYReset=true

[Install]
WantedBy=multi-user.target

这不管用。

答案1

设法解决它:

[email protected]

因为这只能从 tty(VMWare 控制台或裸机)使用

相关内容