在同一 Linux 上运行 2 个 qbittorrent-nox 实例

在同一 Linux 上运行 2 个 qbittorrent-nox 实例

我已经在无头服务器上使用 qbittorrent-nox + WebUI 几个月了,它运行得很好。

我想将我播种并保持活跃数月的种子与我下载、播种一段时间并删除的普通种子分开。

是否可以让 qBittorrent 和 WebUI 在 2 个实例中运行,每个实例都有自己的端口和设置,以便我可以更好地组织我的 torrent?

答案1

是的,这是可能的。在要运行 qbittorent-nox 的用户下运行以下命令:

/usr/bin/qbittorrent-nox --configuration=user1 -d --webui-port=8001
sleep 1
rm /tmp/qtsingleapp-qBitto-*
/usr/bin/qbittorrent-nox --configuration=user2 -d --webui-port=8002

这里有三件事:

  • 您应该为每个用户配置不同的WebUI端口;
  • 您应该为每个用户配置不同的配置子目录;
  • 在启动新实例之前,您应该删除先前实例创建的锁定文件。 QBittorrent 使用它来查找其实例,否则将拒绝启动新实例,告诉您“qbittorrent 已在运行”

sleep 1 让第一个实例运行一下并创建锁定文件(然后将其删除)。

答案2

我从 /etc/rc.local 运行两个 qbittorrent 实例,其中包含以下内容:

运行_nox() {

  local WEBUI_PORT=$1
  [ ! -e /tmp/$WEBUI_PORT ] && mkdir /tmp/$WEBUI_PORT && \
  env -i HOME=/home/ubuntu USER=ubuntu TMPDIR=/tmp/$WEBUI_PORT \
  /usr/bin/qbittorrent-nox --configuration=$WEBUI_PORT --webui-port=$WEBUI_PORT -d

}

运行_nox 8080

运行_nox 8081

我已经在 Raspberry Pi 4B(64 位)Ubuntu 20.04 LTS(Focal Fossa)上运行这个程序几个星期了,没有出现任何重大问题。

相关内容