Page 1 of 2

Online all the time!?

Posted: Sun Dec 01, 2013 5:40 pm
by DebianMe
Hello,

I installed qbittorrent on my debian small server and I liked it very much. I followed this guide:

http://www.linuxplained.com/install-qbi ... ui-ubuntu/

But qbittorrent only works when I put: qbittorrent-nox in the terminal using SSH. and if I close the terminal qbittorrent stops working.

How can I let qbittorrent working all the time? like tflux and utorrent?

Thank you!

Re: Online all the time!?

Posted: Sun Dec 01, 2013 9:29 pm
by Peter
Ps.: There is a tutorial in the wiki. I didn't check beforehand, so I just wrote a generic Linux way to do it.
Here: https://github.com/qbittorrent/qBittorr ... t-X-server
I think that one is easier than the one I wrote.

================ My way (using Screen) ================

Simple (Linux, simple).
Install 'screen', and auto-start your script.
To do this:

First step: Launch a terminal. Any you want.

Install screen! (This lets you have terminal sessions. It's cool stuff, read about it.)
# sudo apt-get install screen

Then we make a cool startup script.
# nano -w start_qbittorrent.sh

The contents (just paste it):
#!/bin/bash
screen -S qbnox -d -m qbittorrent-nox


Then finally, we need to autostart it.
sudo nano -w /etc/rc.local

And add a LINE !! BEFORE !! exit 0:
su USERNAME -c /home/USERNAME/start_qbittorrent.sh

Replace USERNAME with your username.
See screenshot for what I mean:
http://i.imgur.com/XluwDb3.png

Notes:
- There are many ways to auto-start it, I think in this case rc.local is perfect.
But read about other ways here: http://askubuntu.com/questions/814/how- ... n-start-up
As it does not matter when we start it (before we log in or not.)

- As you can see we used the specific 'start_qbittorrent.sh' filename. And your home, as the file's location.
But you can change these up, however you want!
If you want a (dot) . before the filename, it will be hidden.

So I would make it called ".qbnoxstart.sh", and modify the rc.conf part. And there you go.
Lemme know if something does not work.

Re: Online all the time!?

Posted: Sun Dec 01, 2013 10:42 pm
by DebianMe
Wow, thanks a lot ;)

I followed the guide here: https://github.com/qbittorrent/qBittorr ... t-X-server

Did everything. Made that script. Rebooted the server too.

Then I couldn't access qbittorrent, so I entered the command line in the terminal and it worked. Once I closed the terminal the webpage stopped working :(

I don't know how to use command very much. But please can you show me the script? I use WinSCP and I can upload files to directories easier...but I don't know how to use nano very hard for me..

Thanks a lot for your long reply. Much appreciated.

Re: Online all the time!?

Posted: Sun Dec 01, 2013 10:54 pm
by Peter
So you did all the steps on the bottom, and it does not auto-start... right?
Try opening a terminal, and issuing: /etc/init.d/qbittorrent-nox-daemon start

See what happens. If it's some error, tell me.
(Now I'll go to sleep, but will check your reply once I wake up.) Good luck!

Re: Online all the time!?

Posted: Sun Dec 01, 2013 10:57 pm
by DebianMe
Yes ;)

I entered this and I got:

start-stop-daemon: user '[USERNAME]' not found

Re: Online all the time!?

Posted: Mon Dec 02, 2013 7:47 am
by Peter
Hmm. I'll have to edit the wiki, because it does not even mention the need to edit.

So. Open that file with a text editor.
Like so:
sudo nano -w /etc/init.d/qbittorrent-nox-daemon

And go to the USERNAME=[USERNAME] part.
Replace your [USERNAME] with your username.

So the line will look like this (for example, ofc.):
USERNAME=sergei

That should do the trick.

Re: Online all the time!?

Posted: Mon Dec 02, 2013 1:01 pm
by DebianMe
BOOM BOOM BOOM!

Thanks a lot it worked :D

now I closed the terminal and all working great :D

But what if a day I want to stop qBittorrent?

You created this script? Niceee job bro.

Very easy to install :D

Re: Online all the time!?

Posted: Mon Dec 02, 2013 3:35 pm
by Peter
I just edited the wiki, but it's easy to make such scripts. It's called "init script". There are many great tutorials around.

How to stop it from running? Bottom of the page.
sudo update-rc.d -f qbittorrent-nox-daemon remove

Re: Online all the time!?

Posted: Mon Dec 02, 2013 10:37 pm
by DebianMe
Thanks a lot for your help Shiki ;)

Re: Online all the time!?

Posted: Sun Dec 08, 2013 5:33 pm
by DebianMe
Hello shiki, I installed qbittorrent on a dedicated server. I have the same problem. I followed all the guide and installed the same file in init.d

But I'm getting problem:


root@ks396986:~#  sudo update-rc.d qbittorrent-nox-daemon defaults
update-rc.d: using dependency based boot sequencing
root@ks396986:~# /etc/init.d/qbittorrent-nox-daemon start
-bash: /etc/init.d/qbittorrent-nox-daemon: /bin/sh^M: bad interpreter: No such file or directory

--

But the file is there. 100%.

For now I'm using qbittorrent on my small VPS.

Thanks!

Re: Online all the time!?

Posted: Sun Dec 08, 2013 11:52 pm
by Peter
Something is messed up with your qbittorrent-nox-daemon file.
Try to download the file and check it with Notepad++.

(It complains about the very first line.)
Try downloading the file with wget, instead of copy-paste it with a text editor or something.

Re: Online all the time!?

Posted: Mon Dec 09, 2013 9:07 am
by DebianMe
BOOM BOOM it worked :)

But

sudo wget -O /etc/init/qbittorrent-nox-daemon http://launchpadlibrarian.net/38905385/qbittorrent

Is right?

Shouldn't be init.d? and not just init?

Re: Online all the time!?

Posted: Tue Dec 10, 2013 7:53 am
by Peter
You are right, it's a typo in that command. (well, not a typo. I had a VM without X. While I did try out the commands, I didn't copy-paste them, sorry. (The wget command would fail anyway if there is no such dir.))

update: fixed the wiki

Re: Online all the time!?

Posted: Sat Dec 14, 2013 10:08 am
by DebianMe
My friend shiki, I have a small server from OVH. I have torrentflux installed and qbittorrent. Both are the same for them, easy to use.

But which one is better for the CPU/RAM?

Re: Online all the time!?

Posted: Sat Dec 14, 2013 10:30 am
by Peter
torrentflux is crap.
just install rtorrent, that's the lightest client.