补充设置。

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