EraseData plugin works on apache2 but not with lighttpd

dsouvik215

Member
May 25, 2018
896
0
16
Hi, i am pretty new to linux so my knowledge is limited tongue.gif
rtorrent/lib : 0.9.3/0.13.3 rutorrent/plugins: 0.3.4

I got 2 vm's running debian 6, they use the same directory format and the rtorrent / rutorrent configs are the same. Only difference is one has apache2 installed the other lighttpd.
Both use mod_scgi with rpc/httprpc disabled. User nihim runs rtorrent and have done chown -R www-data:www-data /var/www/rutorrent . Files are getting saved in ~/.rtorrent/.download which has nihim:nihim and permissions 664.

Both rutorrents work fine, no errors, they dl / upload just fine, on the apache vm erasedata works fine! but on the lighttpd vm, if i use it, rtorrent log has:

Quote
PHP Warning: touch(): Unable to create file /var/www/rutorrent/share/users/nihim/settings/erasedata/scheduler.lock because Permission denied in /var/www/rutorrent/plugins/erasedata/update.php on line 70
PHP Warning: unlink(/var/www/rutorrent/share/users/nihim/settings/erasedata/scheduler.lock): No such file or directory in /var/www/rutorrent/plugins/erasedata/update.php on line 87​


Any idea why i get that error and why on apache2 it works?

Thx.
 

das329717

Member
May 25, 2018
928
0
16
All files inside rutorrent/share must be accessible by www *and* rtorrent user for read/write.
 

dsouvik215

Member
May 25, 2018
896
0
16
ah yes seems when i moved the rutorrent dir from one vm to another, permissions changed, on the apache vm it has 777 for share/* (which i guess is the default for it cause i didn't set it so) changed that also on the lighttpd vm and it works.

Is that safe though?
 

das329717

Member
May 25, 2018
928
0
16
Is that safe though?
This depends. In any case you can, for example
1) Move ruTorrents user profiles outside www root (see variable $profilePath in the conf/conf.php)
2) Move rtorrent and www users to the same group. And change directory permissions to 0770
 

dsouvik215

Member
May 25, 2018
896
0
16
ok will play with those options. Thx a lot for the swift replies and the awesome work u have done with rutorrent.


EDIT:

also if you don't mind, i changed $topDirectory so diskspace plugin shows the correct info and not the size of /var
I remember seeing on a ticket that you have said other plugins use that variable. Could you name some that might produces problems if that is changed?
Or what line i could mofiy in diskspace files to manually set the path it should use.

Since those are multiple questions and the thread was for something else, feel free to not answer any of them smiley.gif
 

dsouvik215

Member
May 25, 2018
896
0
16
user being the rutorrent user right?

hmm so since i changed it to /home/nihim/.rtorrent it should be ok right?
 

jith45

Member
May 25, 2018
960
0
16
This depends. In any case you can, for example
1) Move ruTorrents user profiles outside www root (see variable $profilePath in the conf/conf.php)
2) Move rtorrent and www users to the same group. And change directory permissions to 0770
moved it outside www updated path on conf.php and changed $profileMask = 0770;
added nihim and www-data to the group rtor and did:
Quote
sudo chown -R www-data:rtor /var/share
sudo chmod -R 770 /var/share
sudo chmod g+s /var/share
-the same for /var/www/rutorrent​

also set on rtorrent system.umask.set = 007 to match it.

but i get:
Quote
06.12.2012 23:07:55] Webserver user doesn't have read/write/execute access to the torrents directory. You cannot add torrents via ruTorrent. (/var/share/users/nihim/torrents)
[06.12.2012 23:07:55] Webserver user doesn't have read/write/execute access to the settings directory. ruTorrent settings cannot be saved. (/var/share/users/nihim/settings)
[06.12.2012 23:07:55] rTorrent user must have read/execute access to the torrents directory. You cannot add torrents via ruTorrent. (/var/share/users/nihim/torrents)
[06.12.2012 23:07:55] rTorrent user must have read/write/execute access to the settings directory. (/var/share/users/nihim/settings)
[07.12.2012 00:00:39] rTorrent user must have read/execute access to the file ./test.sh (/var/www/rutorrent/php/test.sh)
[07.12.2012 00:00:39] rss: Plugin will not work. rTorrent user must have read access to the file (/var/www/rutorrent/plugins/rss/update.php).
[07.12.2012 00:00:39] rss: Plugin will not work. rTorrent user must have read access to the file (/var/www/rutorrent/plugins/rss/rss.php).
[07.12.2012 00:00:39] rss: Plugin will not work. rTorrent user must have read access to the file (/var/www/rutorrent/plugins/rss/conf.php).
[07.12.2012 00:00:39] history: Plugin will not work. rTorrent user must have read access to the file (/var/www/rutorrent/plugins/history/update.php).
[07.12.2012 00:00:39] history: Plugin will not work. rTorrent user must have read access to the file (/var/www/rutorrent/plugins/history/history.php).
[07.12.2012 00:00:39] ratio: Plugin will not work. rTorrent user must have read access to the file (/var/www/rutorrent/plugins/ratio/update.php).
[07.12.2012 00:00:39] ratio: Plugin will not work. rTorrent user must have read access to the file (/var/www/rutorrent/plugins/ratio/ratio.php).
[07.12.2012 00:00:39] ratio: Plugin will not work. rTorrent user must have read access to the file (/var/www/rutorrent/plugins/ratio/conf.php).
[07.12.2012 00:00:39] scheduler: Plugin will not work. rTorrent user must have read access to the file (/var/www/rutorrent/plugins/scheduler/update.php).
[07.12.2012 00:00:39] scheduler: Plugin will not work. rTorrent user must have read access to the file (/var/www/rutorrent/plugins/scheduler/scheduler.php).
[07.12.2012 00:00:39] scheduler: Plugin will not work. rTorrent user must have read access to the file (/var/www/rutorrent/plugins/scheduler/conf.php).
[07.12.2012 00:00:39] autotools: Plugin will not work. rTorrent user must have read access to the file (/var/www/rutorrent/plugins/autotools/move.php).
[07.12.2012 00:00:39] autotools: Plugin will not work. rTorrent user must have read access to the file (/var/www/rutorrent/plugins/autotools/label.php).
[07.12.2012 00:00:39] autotools: Plugin will not work. rTorrent user must have read access to the file (/var/www/rutorrent/plugins/autotools/watch.php).
[07.12.2012 00:00:39] autotools: Plugin will not work. rTorrent user must have read access to the file (/var/www/rutorrent/plugins/autotools/autotools.php).
[07.12.2012 00:00:39] autotools: Plugin will not work. rTorrent user must have read access to the file (/var/www/rutorrent/plugins/autotools/util_rt.php).
[07.12.2012 00:00:39] autotools: Plugin will not work. rTorrent user must have read access to the file (/var/www/rutorrent/plugins/autotools/conf.php).
[07.12.2012 00:00:39] unpack: Plugin will not work. rTorrent user must have read/execute access to the file (/var/www/rutorrent/plugins/unpack/unall_dir.sh).
[07.12.2012 00:00:39] unpack: Plugin will not work. rTorrent user must have read/execute access to the file (/var/www/rutorrent/plugins/unpack/unrar_dir.sh).
[07.12.2012 00:00:39] unpack: Plugin will not work. rTorrent user must have read/execute access to the file (/var/www/rutorrent/plugins/unpack/unrar_file.sh).
[07.12.2012 00:00:39] unpack: Plugin will not work. rTorrent user must have read/execute access to the file (/var/www/rutorrent/plugins/unpack/unzip_dir.sh).
[07.12.2012 00:00:39] unpack: Plugin will not work. rTorrent user must have read/execute access to the file (/var/www/rutorrent/plugins/unpack/unzip_file.sh).
[07.12.2012 00:00:39] create: Plugin will not work. rTorrent user must have read/execute access to the file (/var/www/rutorrent/plugins/create/buildtorrent.sh).
[07.12.2012 00:00:39] create: Plugin will not work. rTorrent user must have read/execute access to the file (/var/www/rutorrent/plugins/create/createtorrent.sh).
[07.12.2012 00:00:39] create: Plugin will not work. rTorrent user must have read/execute access to the file (/var/www/rutorrent/plugins/create/inner.sh).
[07.12.2012 00:00:39] create: Plugin will not work. rTorrent user must have read/execute access to the file (/var/www/rutorrent/plugins/create/mktorrent.sh).
[07.12.2012 00:00:39] create: Plugin will not work. rTorrent user must have read/execute access to the file (/var/www/rutorrent/plugins/create/transmissioncli.sh).
[07.12.2012 00:00:39] erasedata: Plugin will not work. rTorrent user must have read/execute access to the file (/var/www/rutorrent/plugins/erasedata/cat.sh).
[07.12.2012 00:00:39] erasedata: Plugin will not work. rTorrent user must have read/execute access to the file (/var/www/rutorrent/plugins/erasedata/fin.sh).
[07.12.2012 00:00:39] extratio: Plugin will not work. It requires plugin(s) ratio
[07.12.2012 00:00:39] rssurlrewrite: Plugin will not work. It requires plugin(s) rss
[07.12.2012 00:00:39] rTorrent user can't access 'stat' program. Some functionality will be unavailable.
[07.12.2012 00:00:39] rss: Plugin will not work. rTorrent user can't access external program (php).
[07.12.2012 00:00:39] history: Plugin will not work. rTorrent user can't access external program (php).
[07.12.2012 00:00:39] scheduler: Plugin will not work. rTorrent user can't access external program (php).
[07.12.2012 00:00:39] autotools: Plugin will not work. rTorrent user can't access external program (php).
[07.12.2012 00:00:39] unpack: Plugin will not work. rTorrent user can't access external program (php).
[07.12.2012 00:00:39] create: Plugin will not work. rTorrent user can't access external program (php).
[07.12.2012 00:00:39] _task: Some functionality will be unavailable. rTorrent user can't access external program (pgrep).
[07.12.2012 00:00:41] DataDir plugin: rTorrent user can't access php interpreter. Plugin will not work.​


also somehow on a lot of plugins permissions are 710 and when i change them, webserver changes them back?

i don't understand how it can't access them, with those permissions, if i go to /var/share as user nihim and do mkdir test, it works so if i can rtorrent that's started by me (nihim) should too right?

Now i know i could go back to the way they are but want to make this work, it got me interested because it's weird, ofc only if you can offer some help tongue.gif
 

das329717

Member
May 25, 2018
928
0
16
For example, this message:
Code:
[06.12.2012 23:07:55] Webserver user doesn't have read/write/execute access to the settings directory. ruTorrent settings cannot be saved. (/var/share/users/nihim/settings)

PHP code for it:
Code:
$st = getSettingsPath(); // /var/share/users/nihim/settings in your case
@chmod($st,$profileMask); // 0770 in your case
if(!@file_exists($st.'/.') || !is_readable($st) || !is_writable($st))
noty(theUILang.badSettingsPath); // your got this
 

dsouvik215

Member
May 25, 2018
896
0
16
i think i have blown something skyhigh tongue.gif share is 770 with owner www-data and group tor, nihim belongs to tor but i can't cd into it.....

share/users/nihim/settings for some reasons is 1402 !! sudo chmod it to 2770 confirmed it, and when i refreshed webpage it was back to 1402 !