tman1220 / rutorrent

Automatically exported from code.google.com/p/rutorrent
0 stars 0 forks source link

rutorrent erasedata plugin fails to delete data if system user and htdigest user are different #944

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.setup rutorrent with a system username running rtorrent different to 
rutorrent/htdigest username (as per 
http://www.torrent-invites.com/showthread.php?t=272986 and many other tutorials)
2.install erasedata
3.attempt to use 'remove and delete data' 

What is the expected output? What do you see instead?
Deletion is expected but does not occur.

What environment are you using?
1. My ruTorrent version is... 3.6
2. My rTorrent version is... 0.9.2/0.13.2
3. I use web-server... Apache2 it version is... 2.4.7-1ubuntu4 (1 machine)
I use web-server... Nginx it version is... 1.4.6-1ubuntu3 (2 machines)
on OS... Ubuntu 14.04.1
4. I use browser... various

Are some errors present in the web-server log? no

Are some errors present in the browser error console? no

Please provide any additional information below.

 rtorrent exec logging if enabled shows similar to
^@sh -c '/usr/bin/php' '<rutorrent install root 
directory>/plugins/erasedata/update.php' '<system user>' &

---
^@
--- Success ---
^@PHP Warning:  touch(): Unable to create file <rutorrent install root 
directory>/share/users/<system user>/settings/erasedata/scheduler.lock because 
No such file or directory in <rutorrent install root 
directory>/plugins/erasedata/update.php on line 70
PHP Warning:  unlink(<rutorrent install root directory>/share/users/<system 
user>/settings/erasedata/scheduler.lock): No such file or directory in 
<rutorrent install root directory>/plugins/erasedata/update.php on line 87

---
^@<rutorrent install root directory>/plugins/erasedata/cat.sh <rutorrent 
install root directory>/share/users/<system user>/settings/erasedata 29385 
<download directory>/<torrent data>

---
^@<rutorrent install root directory>/plugins/erasedata/cat.sh: line 6: 
<rutorrent install root directory>/share/users/<system 
user>/settings/erasedata/29385.tmp: No such file or directory

--- Error ---
^@

---
^@sh -c '/usr/bin/php' '<rutorrent install root 
directory>/plugins/erasedata/update.php' '<system user>' &

---
^@
--- Success ---
^@PHP Warning:  touch(): Unable to create file <rutorrent install root 
directory>/share/users/<system user>/settings/erasedata/scheduler.lock because 
No such file or directory in <rutorrent install root 
directory>/plugins/erasedata/update.php on line 70
PHP Warning:  unlink(<rutorrent install root directory>/share/users/<system 
user>/settings/erasedata/scheduler.lock): No such file or directory in 
<rutorrent install root directory>/plugins/erasedata/update.php on line 87

Symlinking <rutorrent install root directory>/share/users/<system user> to 
<rutorrent install root directory>/share/users/<htdigest user> fixes the issue 

ie
cd <rutorrent install root directory>
ln -s <system user> <htdigest user> 

may be useful to add this fix to the erasedata plugin wiki page or change the 
plugin to use the rutorrent user rather than rtorrent/system user.

Original issue reported on code.google.com by mycosyst...@gmail.com on 27 Aug 2014 at 12:42

GoogleCodeExporter commented 8 years ago
1) You have an incorrect configuration. ruTorrent doesn't operate with a 
'system user' at all. Replace all names in the ruTorrent configuration files 
(and line of plugin initialization in the .rtorrent.rc) from 'system' to 
'htdigest' name.
2) Project is moved to the github. Use right place for your issues, please. 
https://github.com/Novik/ruTorrent/issues

Original comment by novik65 on 28 Aug 2014 at 11:38

GoogleCodeExporter commented 8 years ago
Rutorrent may not use a system user but rtorrent does and your erasedata plugin 
is attempting to use that username mate - the name of the user running 
rtorrent. Nowhere in my rutorrent config files is the <system user> name found 
but it is still attempting to use it - hence having to make a symlink of the 
name <system user> to the htdigest user configured in rtorrent.
Then again what the f would i know i have only been using *nix for 25 years.
I am arthritic so you can use the info or pretend it doesnt exist. Not going 
through the pain of typing it again.

Original comment by mycosyst...@gmail.com on 28 Aug 2014 at 11:45

GoogleCodeExporter commented 8 years ago
Yet once. ruTorrent doesn't operate with a rtorrent user at all. It even 
doesn't know his name. 
CHECK PLUGIN INITIALIZATON LINE IN THE .rtorrent.rc. 
Are you understand my words?

Original comment by novik65 on 29 Aug 2014 at 4:40

GoogleCodeExporter commented 8 years ago
Ah - its an error in that and other tutorials - i got you.
In section 4.6 of that tut (tho it says do it by hand in nano) I used %s/<user 
name>/<htdigest user>/g on the .rtorrent.rc to replace all instances of <user 
name> with <system user>
but the line 

execute = {sh,-c,/usr/bin/php /var/www/rutorrent/php/initplugins.php <user 
name> &}
should be 
execute = {sh,-c,/usr/bin/php /var/www/rutorrent/php/initplugins.php <WEB User 
Name> &}

In the parlance of that tutorial.

So the fix is to edit .rtorrent.rc and change that final line, the line that 
initialises the plugins, from <system user> to <htdigest user>.

Awesome - hopefully now googling rutorrent does not delete data or similar will 
bring this up - which was the whole point of doing this :) Sorry for the 
misunderstanding i was having an SOB of a day.

Thank you so very very much for getting to the bottom of this, hopefully some 
other people will benefit from the fix to what seems to be a pretty common 
error :)
Hopefully someone who is a member of that site will tell them to fix the 
rotorrent tuts lol

Original comment by mycosyst...@gmail.com on 29 Aug 2014 at 5:14

GoogleCodeExporter commented 8 years ago
Oh yeah, and i posted here because your forum says to :)
http://forums.rutorrent.org/index.php?topic=479.0

Original comment by mycosyst...@gmail.com on 29 Aug 2014 at 5:16

GoogleCodeExporter commented 8 years ago
Kudos on updating the thread but your wording there is very unclear, tho i 
understand english is not your first language. I mean no disrespect but might I 
suggest:

The project has been moved from the google code to github.
Please use the following link for any bug or issue reports, rather than the 
(very old) google link above.

Original comment by mycosyst...@gmail.com on 5 Sep 2014 at 3:04