AdGuard Linux 版无法在系统启动时自动运行,如何开启开机自启?
在使用 systemd 的发行版上,需要手动启用服务。请创建服务文件
/etc/systemd/system/adguard-cli.service 并添加以下配置:[Unit]
Description=AdGuard CLI
After=network.target
[Service]
Type=forking
WorkingDirectory=/opt/adguard-cli
ExecStart=/opt/adguard-cli/adguard-cli start
ExecStop=/opt/adguard-cli/adguard-cli stop
Restart=always
TimeoutStartSec=0
TimeoutStopSec=0
StandardOutput=journal
RemainAfterExit=yes
User=username
[Install]
WantedBy=multi-user.target
In the User=username parameter, replace username with your Linux username.
- Run the following commands to enable the service:
systemctl daemon-reload systemctl enable --now adguard-cli
很高兴能够帮助您!
如果您有任何问题或建议,请通过电子邮箱联系我们 support@adguard.com


