Pomoc Rtorrent pro is dead

Louis

Passing Basics
Beginner
11 Październik 2015
13
3
3
70
QNAP
TS-x53
Ethernet
1 GbE
<-- Please remind: English only. Don't forget to delete this line when writing post and fill FW version and model name bellow. -->

Firmware version: 4.3.3.0299
Model name: QNAP TS-453 pro
rtorrent_0.9.6-0806-180806_x86_64_PRO

After reboot Rtorrent pro is dead completely.
It took me ages to even realise that since v4.3 firmware we need to use BASH before running /etc/init.d/rtorrent.sh to do anything. That made it impossible to shut down/ restart or even uninstall - in fact trying to uninstall through the app center will fail.

Anyway now I have a problem when running Rtorrent and am totally stuck - I hope I can get support here for the pro version.

here is what I get and am going round in circles.

Kod:
bash /etc/init.d/rtorrent.sh status
(info) rtorrent: Program located in PROGDIR: /share/CACHEDEV1_DATA/.qpkg/rtorrent and executed at ORIGDIR: /share/homes/admin
(info) rtorrent: RT_DOWNLOAD_SHARE: /share/Download
(info) rtorrent: process lighttpd pid file not found!
(info) rtorrent: process rtorrent pid file not found!

So let's try starting it:
Kod:
bash /etc/init.d/rtorrent.sh start
(info) rtorrent: Program located in PROGDIR: /share/CACHEDEV1_DATA/.qpkg/rtorrent and executed at ORIGDIR: /share/homes/admin
(info) rtorrent: RT_DOWNLOAD_SHARE: /share/Download
(err!) rtorrent: application already started!

Says it's started so lets try to stop it

Kod:
bash /etc/init.d/rtorrent.sh stop
(info) rtorrent: Program located in PROGDIR: /share/CACHEDEV1_DATA/.qpkg/rtorren                                 t and executed at ORIGDIR: /share/homes/admin
(info) rtorrent: RT_DOWNLOAD_SHARE: /share/Download
init.d/lighttpd: PID file not found: /var/run/rtorrent-webserver.pid
(    ) rtorrent: Port removing: UPnP --------
(info) rtorrent: Removing UPnP mapped ports...
(    ) rtorrent: Port removing: NAT-PMP -----
(info) rtorrent: PortMapper: Exits with exit status (0)
(warn) rtorrent: lighttpd error occured while executing stop sequence.
init.d/rtorrent: Stopping engine program: rtorrent
init.d/rtorrent: Socket/Lock file: /share/Download/rtorrent/session/rtorrent.loc                                 k NOT FOUND
(warn) rtorrent: rtorrent error occured while executing stop sequence.
init.d/php5-fpm: Gracefully shutting down warning, no pidfile found - ..is not r                                 unning ?

(warn) rtorrent: php-fpm error occured while executing stop sequence.
init.d/monitorix: PID file not found: /var/run/rtorrent-monitorix.pid
(warn) rtorrent: monitorixd error occured while executing stop sequence.
init.d/rtorrent: Force Stop engine program: rtorrent
error:   Forever cannot find process with id: server/bin/start.js
(info) rtorrent: Removing link: /usr/bin/mc
(info) rtorrent: Removing link: /usr/bin/rtorrent
(info) rtorrent: Waiting for background processes to finish... (11687 )
(info) rtorrent: Background jobs done. (11687 )
/etc/init.d/rtorrent.sh: line 1660: /usr/bin/rtorrent/bin/rm: No such file or di                                 rectory
[admin@NAS253 ~]# bash /etc/init.d/rtorrent.sh stop
(info) rtorrent: Program located in PROGDIR: /share/CACHEDEV1_DATA/.qpkg/rtorren                                 t and executed at ORIGDIR: /share/homes/admin
(info) rtorrent: RT_DOWNLOAD_SHARE: /share/Download
init.d/lighttpd: Base environment not ready.
(warn) rtorrent: lighttpd error occured while executing stop sequence.
init.d/rtorrent: Base environment not ready.
(err!) rtorrent: PortMapper: Exits with exit status (1)
(err!) rtorrent: (/share/CACHEDEV1_DATA/.qpkg/rtorrent/etc/def.p/portmapper.sh)                                  basedir is missing


(warn) rtorrent: rtorrent error occured while executing stop sequence.
init.d/php5-fpm: Base environment not ready.
(warn) rtorrent: php-fpm error occured while executing stop sequence.
init.d/monitorix: Base environment not ready.
(warn) rtorrent: monitorixd error occured while executing stop sequence.
init.d/lighttpd: Base environment not ready.
init.d/rtorrent: Base environment not ready.
init.d/php5-fpm: Base environment not ready.
init.d/monitorix: Base environment not ready.
error:   Forever cannot find process with id: server/bin/start.js
(info) rtorrent: Removing link: /usr/bin/mc
rm: cannot remove '/usr/bin/mc': No such file or directory
(info) rtorrent: Removing link: /usr/bin/rtorrent
rm: cannot remove '/usr/bin/rtorrent': Is a directory
(info) rtorrent: Waiting for background processes to finish... (15265 )
(info) rtorrent: Background jobs done. (15265 )
<_DATA/.qpkg/rtorrent and executed at ORIGDIR: /share/homes/admin
-sh: syntax error near unexpected token `rtorrent:'
[admin@NAS253 ~]# (info) rtorrent: RT_DOWNLOAD_SHARE: /share/Download
-sh: syntax error near unexpected token `rtorrent:'
<ghttpd: PID file not found: /var/run/rtorrent-webserver.pid
-sh: init.d/lighttpd:: No such file or directory
[admin@NAS253 ~]# (    ) rtorrent: Port removing: UPnP --------
-sh: syntax error near unexpected token `)'
[admin@NAS253 ~]# (info) rtorrent: Removing UPnP mapped ports...
-sh: syntax error near unexpected token `rtorrent:'
[admin@NAS253 ~]# (    ) rtorrent: Port removing: NAT-PMP -----
-sh: syntax error near unexpected token `)'
[admin@NAS253 ~]# (info) rtorrent: PortMapper: Exits with exit status (0)
-sh: syntax error near unexpected token `rtorrent:'
<orrent: lighttpd error occured while executing stop sequence.
-sh: syntax error near unexpected token `rtorrent:'
[admin@NAS253 ~]# init.d/rtorrent: Stopping engine program: rtorrent
-sh: init.d/rtorrent:: No such file or directory
</share/Download/rtorrent/session/rtorrent.lock NOT FOUND
-sh: init.d/rtorrent:: No such file or directory
<orrent: rtorrent error occured while executing stop sequence.
-sh: syntax error near unexpected token `rtorrent:'
<g down warning, no pidfile found - ..is not running ?
-sh: init.d/php5-fpm:: No such file or directory
This is stuck here

Let's try a restart

Kod:
bash /etc/init.d/rtorrent.sh restart
(info) rtorrent: Program located in PROGDIR: /share/CACHEDEV1_DATA/.qpkg/rtorrent and executed at ORIGDIR: /share/homes/admin
(info) rtorrent: RT_DOWNLOAD_SHARE: /share/Download
(info) rtorrent: 1/2 -- Executing shut down sequence
/etc/init.d/rtorrent.sh: line 375: syntax error: unexpected "("
(err!) rtorrent: Errors occured during stop sequence. Code: 2

And now I get the famous line /etc/init.d/rtorrent.sh: line 375: syntax error: unexpected "("
which you get if you don't use "bash" when you run the script.

So this is where I give up I have no answer to this but I bought and paid for pro so hopefully this is where to get support as I don't know where else I can go as the main qnap forum is no help at all.

How do I get around this problem please?
 
well .. some of us got thing, called PRIVATE LIFE - can't you just wait ? Silas will surely get to you :)

PS: look at head of file /etc/init.d/rtorrent.sh - there's a line called shebang (dunno why they called it that way xD).

How does it look ? head /etc/init.d/rtorrent.sh

you should not call it using bash .. just call it as any program - full path and command (stop/start and so on ).
 
well .. some of us got thing, called PRIVATE LIFE - can't you just wait ? Silas will surely get to you :)

PS: look at head of file /etc/init.d/rtorrent.sh - there's a line called shebang (dunno why they called it that way xD).

How does it look ? head /etc/init.d/rtorrent.sh

you should not call it using bash .. just call it as any program - full path and command (stop/start and so on ).

Yeah I'm sorry but for months before pro I tried every conceivable way to get an answer from Silas and never did. I always said I'd be happy to buy it to support his efforts provided support was part of that. I don't intend for people to interrupt their private life and do respect that but I did hope that Silas would be prepared to help sort problems with the paid verison and this is a VERY LONG Ongoing problem.

Anyway the problem I had for those many months since installing the version for QTS 4.3 is that any attempt to run
/etc/init.d/rtorrent.sh would result in this:

syntax error: unexpected "(" and that meant any time I tried to do anything - start / stop / restart etc would result in this.
It never used to be before 4.3 and then I found out somehow from some unrelated forum that bash in front of this is necessary and that worked.
Now it still doesn't in the case of

/etc/init.d/rtorrent.sh restart even if I didn't this is not helping - because rtorrent cannot be stopped / restarted without having to completely reinstall and this also will cause a problem when the NAS is rebooted and that is a big pain. There must be a solution.

The sheebang line btw is #!/usr/bin/env sh and for my limited knowledge it should be fine to just run it ( as you sugges) if the default is sh but I can assure you it certainly doesn't work and I don't know why especially if it works for everyone else. I don't have anything unusual on my NAS it's just a TS453 pro with 4.3.3 firmware and entware also installed.
 
Louis ... First of all it's just few hours from reported issue.
The support is instant and you said you tried to reach me several times but I ignored you. But you can find that I answer for all open cases. Unfortunately I'm on a business trip and I'll be back at Monday.

Reported problem is really strange. I believe you have some mess in QTS. And @pigers have right there is something wrong with your shell.

I'll try to find a window tomorrow to help you with this case but I believe it would be better for you to reinitialize the NAS. There is something wrong with busybox for which rtorrent init script is written.

BTW what apps do you have installed in Entware-ng? And is it Entware-ng or different Entware?

What's the output of export and printenv command
 
I'll try to find a window tomorrow to help you with this case but I believe it would be better for you to reinitialize the NAS. There is something wrong with busybox for which rtorrent init script is written.

BTW what apps do you have installed in Entware-ng? And is it Entware-ng or different Entware?

What's the output of export and printenv command

Ok Sorry Silas, I'm glad you reply here. Previous attempts were when you released the version for 4.3 and I tried to get some help via the qnap forum and by emailing you directly but that is many months ago. I bought pro and didn't seem to have a problem once I found the 'Bash' solution but then I don't reboot the nas very often.

To answer some questions:
Version of Rtorrent downloaded when I paid in August this year: rtorrent_0.9.6-0806-180806_x86_64_PRO
This shouldn't matter however, as I have had this problem since the 4.3 version and well before pro.

Entware: I think I have the version recommended (it got confusing) but if I look at the icon - it says "Entware-3x 0.99std" - Confusing because one of the versions I was told was obsolete and that may have been the ng one possibly.
Apps really I think I've installed an editor and some basic utils but I installed this primarily for Open SSH.

Before you come to a possible conclusion here I used both Qnap SSH access to make sure this wasn't something to do with Open SSH.

Export command gives:
Kod:
export DMALLOC_OPTIONS="debug=0x34f47d83,inter=100,log=logfile"
export EDITOR="/bin/vi"
export HISTFILESIZE="1000"
export HISTSIZE="1000"
export HOME="/share/homes/admin"
export HOSTNAME="NAS253"
export INPUTRC="/etc/inputrc"
export JAVA_HOME="/usr/local/jre"
export LANG="en_US.UTF-8"
export LC_ALL="en_US.UTF-8"
export LC_CTYPE="en_US.UTF-8"
export LOGNAME="admin"
export LOO="/share/CACHEDEV1_DATA/homes/admin"
export LS_COLORS="no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.jpg=01;35:*.jpeg=01;35:*.png=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.mpg=01;35:*.mpeg=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:"
export MAIL="/var/mail/admin"
export OLDPWD
export PAGER="/bin/more "
export PATH="/opt/bin:/opt/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin"
export PS1="[\\u@\\h \\W]\\\$ "
export PWD="/share/homes/admin"
export SHELL="/bin/sh"
export SHLVL="1"
export SSH_CLIENT="192.168.1.2 49790 22"
export SSH_CONNECTION="192.168.1.2 49790 192.168.1.118 22"
export SSH_TTY="/dev/pts/5"
export TEMP="/opt/tmp"
export TERM="xterm"
export TERMINFO="/opt/share/terminfo"
export TMP="/opt/tmp"
export USER="admin"

printenv doesn't work but env gives:

Kod:
HOSTNAME=NAS253
TERM=xterm
SHELL=/bin/sh
HISTSIZE=1000
SSH_CLIENT=192.168.1.2 49835 12121
SSH_TTY=/dev/pts/5
LC_ALL=en_US.UTF-8
HISTFILESIZE=1000
USER=admin
TEMP=/opt/tmp
LS_COLORS=no=00:fi=00:di=01;34:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.jpg=01;35:*.jpeg=01;35:*.png=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.mpg=01;35:*.mpeg=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:
PAGER=/bin/more
MAIL=/var/mail/admin
PATH=/opt/bin:/opt/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin
INPUTRC=/etc/inputrc
PWD=/root
JAVA_HOME=/usr/local/jre
EDITOR=/bin/vi
LANG=en_US.UTF-8
DMALLOC_OPTIONS=debug=0x34f47d83,inter=100,log=logfile
PS1=[\w] #
SHLVL=1
HOME=/root
TERMINFO=/opt/share/terminfo
TMP=/opt/tmp
LOGNAME=admin
LC_CTYPE=en_US.UTF-8
SSH_CONNECTION=192.168.1.2 49835 192.168.1.118 12121
_=/opt/bin/env

Ok ....... the second one was using qnap ssh and at the top when I logged in I got this which is a big clue obviously:
Kod:
  * To start using rtorrent-environment you need to run `source /usr/bin/rtorrent/env`

After running source /usr/bin/rtorrent/env then I can run the commands without bash ... hooray!

.. and now I can start / stop / restart ..... Gawd!
Ok so why is this source /usr/bin/rtorrent/env line not being run with either Qnap ssh or Open ssh and where's the best place to force it to run?

The only thing I cannot check now is after a reboot because the NAS is set up for a remote access support call for an unrelated issue and if I reboot this will kill the session. I'll have to wait for them to do their thing before I check that but it looks like the crux of the problem is here.
 
So the problem is your openssh or what?
no it's not
When I log on to Qnap SSH I get a warning * To start using rtorrent-environment you need to run `source /usr/bin/rtorrent/env

here is what I see in when I run cat .profile from the root (Qnap ssh)

Kod:
export PS1='[\w] # '
reset
source /opt/etc/profile


# Hello from rtorrent
[ -f "/usr/bin/rtorrent/root/.profile" ] && source /usr/bin/rtorrent/root/.profile




export TERM=xterm
screen -Rd helpdesk

If I use Open ssh then my .profile is in /shares/homes/admin and in that I have added the line "source /usr/bin/rtorrent/env" and that sorts open ssh
I would probably have to do the same for qnap ssh but I don't use the qnap ssh anyway that's why I installed open ssh.

From what I can see it's nothing to do with open ssh
Whatever the initalisation of rtorrent when installed the env variable doesn't make it and so the whole thing appears to break.

I would think you should perhaps have a better clue as to why source /usr/bin/rtorrent/env which I am guessing should be run isn't, and why you have put the above stuff into the main root profile what is that actually supposed to do?
Sorry but I am still shakey on Linus but learning as I go along...

Let's be clear at this point the "warning and my findings below are within a Qnap ssh session.

EDIT so that warning is found here: if I cat /usr/bin/rtorrent/root/.profile
there it is ..
Kod:
# Hello from rtorrent
[ -f "/usr/bin/rtorrent/env" ] && echo '

  * To start using rtorrent-environment you need to run `source /usr/bin/rtorrent/env`
 
Well for now I can put the necessary line into my .profile for Open ssh and that seems to sort it out - What is important here is that I can now start / stop and restart rtorrent without problems. Even when using bash before it was fatal to stop rtorrent and this is how it has been for about 1 year at least. You have no idea how many times I have reinstalled rtorrent just because I rebooted my NAS.

As for your question - I am not going to reinstall the NAS that would be extreme and to be avoided if at all possible. I have too many things I've done and not enough time to reset everything up. For now I think the solution is ok the only thing I can't test right now is if it will reboot ok.

I still can't say I understand why the line that fixes it needs to be run and you haven't told me how rtorrent makes sure this would normally be executed. Either way I can work around it now ....hopefully.

I can see though that one of the lines in /usr/bin/rtorrent/env is this:
Kod:
export SHELL=/usr/bin/rtorrent/bin/bash
.... and that explains a lot!

Can I just delete the rtorrent specific lines in the .profile then? I don't use rtorrent in command line mode ever.
 

Użytkownicy znaleźli tą stronę używając tych słów:

  1. rtorren
  2. To start using rtorrent-environment you need to run `source /usr/bin/rtorrent/env`