[Solved] qBT-nox with Fedora

Linux specific questions, problems.
Post Reply
Benjamin Linus

[Solved] qBT-nox with Fedora

Post by Benjamin Linus »

Hi, I'm having some trouble with qbittorrent-nox under fedora 19 running on my home server, because I use to access to the server via ssh from another computer and when start qbt-nox and logout from ssh qbt quit too. So I want to prevent qbt quitting every time logging out ssh but I can't figure out.

Second point is how create a daemon of qbt so it can start on boot? instructions are only for ubuntu :|

Thank you so much :)))

p.s. sorry for my english :)
Last edited by Benjamin Linus on Sun Jan 26, 2014 2:16 pm, edited 1 time in total.
Benjamin Linus

Re: [Solved] qBT-nox with Fedora

Post by Benjamin Linus »

Finally solved :)))

First of all I've installed 'screen' sudo yum install screen, created a qbittorren-nox.service file in /lib/systemd/system/:
credit goes to Diego

Code: Select all

https://aur.archlinux.org/packages/qbittorrent-nogui/?setlang=it

Code: Select all

[Unit]
Description=Qbittorrentd Service
After=network.target

[Service]
Type=forking
User=USER
ExecStart=/usr/bin/screen -dmS qbittorrent-nox qbittorrent-nox
ExecStop=/usr/bin/screen -S qbittorrent-nox -X quit

[Install]
WantedBy=multi-user.target 
Change USER with your username

Code: Select all

sudo qbittorrent-nox
type 'y'

Code: Select all

sudo systemctl enable qbittorrent-nox.service
sudo systemctl start qbittorrent-nox.service
Last edited by Benjamin Linus on Sun Jan 26, 2014 2:25 pm, edited 1 time in total.
Brogyi

Re: [Solved] qBT-nox with Fedora

Post by Brogyi »

The above service is working but I have noticed the PID handling not good. When I stop the service and restart it then I can not find on "top" screen.
The qbittorrent-nox is working. I insert the terminal text.

Code: Select all

[brogyi@antergos ~]$ sudo systemctl status qbittorrent.service
? qbittorrent.service - qbittorent-nox Service
   Loaded: loaded (/usr/lib/systemd/system/qbittorrent.service; enabled; vendor preset: disabled)
   Active: active (running) since Sat 2015-08-08 11:49:42 CEST; 2min 48s ago
  Process: 352 ExecStart=/usr/bin/screen -dmS qbittorrent-nox qbittorrent-nox (code=exited, status=0/SUCCESS)
 Main PID: 362 (screen)
   CGroup: /system.slice/qbittorrent.service
           ??362 /usr/bin/SCREEN -dmS qbittorrent-nox qbittorrent-nox
           ??363 qbittorrent-nox

Aug 08 11:49:42 antergos systemd[1]: Starting qbittorent-nox Service...
Aug 08 11:49:42 antergos systemd[1]: Started qbittorent-nox Service.
[brogyi@antergos ~]$ top | grep 363
  363 brogyi    20   0  415.4m  19.6m   0.0  0.2   0:00.24 S      `- qbittorrent-nox                                                                              

[brogyi@antergos ~]$ sudo systemctl stop qbittorrent.service  
[brogyi@antergos ~]$ sudo systemctl status qbittorrent.service
? qbittorrent.service - qbittorent-nox Service
   Loaded: loaded (/usr/lib/systemd/system/qbittorrent.service; enabled; vendor preset: disabled)
   Active: inactive (dead) since Sat 2015-08-08 11:53:32 CEST; 5s ago
  Process: 2930 ExecStop=/usr/bin/screen -S qbittorrent-nox -X quit (code=exited, status=0/SUCCESS)
  Process: 352 ExecStart=/usr/bin/screen -dmS qbittorrent-nox qbittorrent-nox (code=exited, status=0/SUCCESS)
 Main PID: 362 (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/qbittorrent.service

Aug 08 11:49:42 antergos systemd[1]: Starting qbittorent-nox Service...
Aug 08 11:49:42 antergos systemd[1]: Started qbittorent-nox Service.
Aug 08 11:53:32 antergos systemd[1]: Stopping qbittorent-nox Service...
Aug 08 11:53:32 antergos systemd[1]: Stopped qbittorent-nox Service.
[brogyi@antergos ~]$ sudo systemctl start qbittorrent.service
[brogyi@antergos ~]$ sudo systemctl status qbittorrent.service
? qbittorrent.service - qbittorent-nox Service
   Loaded: loaded (/usr/lib/systemd/system/qbittorrent.service; enabled; vendor preset: disabled)
   Active: active (running) since Sat 2015-08-08 11:54:03 CEST; 4s ago
  Process: 2930 ExecStop=/usr/bin/screen -S qbittorrent-nox -X quit (code=exited, status=0/SUCCESS)
  Process: 2943 ExecStart=/usr/bin/screen -dmS qbittorrent-nox qbittorrent-nox (code=exited, status=0/SUCCESS)
 Main PID: 2944 (screen)
   CGroup: /system.slice/qbittorrent.service
           ??2944 /usr/bin/SCREEN -dmS qbittorrent-nox qbittorrent-nox
           ??2945 qbittorrent-nox

Aug 08 11:54:03 antergos systemd[1]: Starting qbittorent-nox Service...
Aug 08 11:54:03 antergos systemd[1]: Started qbittorent-nox Service.
[brogyi@antergos ~]$ top | grep 2945
Do you have any idea how to change the service code? Thanks.
Post Reply