补充设置。

Signed-off-by: rick.chan <cy@haoan119.com>
This commit is contained in:
rick.chan 2024-06-14 13:23:19 +08:00
parent 71e8718e1f
commit bb0f5ec392
1 changed files with 15 additions and 7 deletions

View File

@ -138,9 +138,11 @@ chkconfig --list | grep mydemo
[Unit]
Description=MyDemo
# After=syslog.target
After=network.target
After=multi-user.target
# After=network.target
# After=multi-user.target
# After=graphical.target
After=plymouth-quit-wait.service
# After=systemd-logind.service
[Service]
RestartSec=2s
@ -155,13 +157,19 @@ Restart=always
WantedBy=multi-user.target
```
也可以视情况将 After=multi-user.target 修改为 After=graphical.target。
也可以使用 After=graphical.target。
然后使用 systemctl 命令控制服务:
```bash
systemctl enable mydemo
systemctl start mydemo
systemctl stop mydemo
systemctl disable mydemo
sudo systemctl enable mydemo
sudo systemctl start mydemo
sudo systemctl stop mydemo
sudo systemctl disable mydemo
```
如果 Screen 的虚拟终端遮蔽了 QPA 应用程序,则可以将其关闭:
```bash
sudo systemctl mask getty@tty1.service
```