./root/dtos/squeeze2upnp-linux-x86_64-static -z -x config.xml 设置为开机启动
时间: 2024-04-02 12:35:58 浏览: 24
要将 squeeze2upnp 设置为开机启动,您需要将该命令添加到系统的启动脚本中。
具体步骤如下:
1. 打开终端并输入以下命令以编辑启动脚本文件:
sudo vi /etc/rc.local
如果您使用的是 systemd 系统,则可以编辑 /etc/systemd/system/rc.local.service 文件。
2. 在文件的末尾添加以下行:
/full/path/to/root/dtos/squeeze2upnp-linux-x86_64-static -z -x /path/to/config.xml &
请注意,必须将“/full/path/to/”替换为 squeeze2upnp 可执行文件的实际路径。
3. 保存并关闭文件。
4. 确保文件可执行。如果您使用的是 systemd 系统,请执行以下命令:
sudo chmod +x /etc/systemd/system/rc.local.service
5. 启用 rc.local 服务。如果您使用的是 systemd 系统,请执行以下命令:
sudo systemctl enable rc-local.service
如果您使用的是其他系统,请根据您的系统文档启用 rc.local 服务。
6. 重新启动系统并检查 squeeze2upnp 是否已在启动时自动启动。
请注意,如果您的系统使用 systemd,则还可以使用 systemctl 命令将 squeeze2upnp 添加到系统的自启动服务中。具体步骤如下:
1. 打开终端并输入以下命令:
sudo vi /etc/systemd/system/squeeze2upnp.service
2. 向文件添加以下内容:
[Unit]
Description=Squeeze2UPnP
[Service]
Type=simple
ExecStart=/full/path/to/root/dtos/squeeze2upnp-linux-x86_64-static -z -x /path/to/config.xml
[Install]
WantedBy=multi-user.target
请注意,必须将“/full/path/to/”替换为 squeeze2upnp 可执行文件的实际路径。
3. 保存并关闭文件。
4. 执行以下命令以重新加载 systemd 守护进程配置:
sudo systemctl daemon-reload
5. 启动 squeeze2upnp 服务:
sudo systemctl start squeeze2upnp.service
6. 将 squeeze2upnp 添加到系统的自启动服务中:
sudo systemctl enable squeeze2upnp.service
7. 重新启动系统并检查 squeeze2upnp 是否已在启动时自动启动。