update scripts for plugins

shwetha17

Member
May 24, 2018
785
0
16
Hi Guys,

Just curious if polling plugins like rss and trafic require you to put the "execute = php ...update.php" thing in your rtorrent.rc file in order to keep polling while rutorrent is not open, e.g. while i am asleep smiley.gif

I ask becuase I see nothing in the documentation about it, but my trafic is not working and i see on here a few people say to try that?


regards,
 

shwetha17

Member
May 24, 2018
785
0
16
Just curious if polling plugins like rss and trafic require you to put the "execute = php ...update.php" thing in your rtorrent.rc file in order to keep polling while rutorrent is not open, e.g. while i am asleep smiley.gif
You dont't need to put to your rtorrent.rc file the "execute = php ...update.php". You must put to your rtorrent.rc another line. And you need to do this for *start* polling immediatelly after rtorrent starts without ruTorrent loading.
I ask becuase I see nothing in the documentation about it,
Really?

http://code.google.com/p/rutorrent/wiki/Plugins?wl=en#Starting_plugins_with_rtorrent
but my trafic is not working and i see on here a few people say to try that?
1) Check files permissions
2) Paste more info. Template here - http://code.google.com/p/rutorrent/issues/entry
 

somus1735

Member
May 25, 2018
833
0
16
I mean I see no documentation about having rtorrent.rc excecute a call to the update.php scripts. The only place I have seen such things is here on this forum and i've no idea why people need to do it. But was thinking the fact I am not doing it is maybe my problem. I have seen and read the one about having it execute the startup script.
1) Check files permissions
2) Paste more info. Template here - http://code.google.com/p/rutorrent/issues/entry
Which file permissions in particular? I have chmod 777'd the entire rutorrent folder, i even went so far as to chmod 777 the rtorrent.rc and all rtorrent session/data folders, although i feel really insecure about doing that, it made no difference.

There are no errors in the /tmp/errors.log that rutorrent is setup to log to, no errors in the apache error log, and no errors appear on the rutorrent "log" tab. It's just that the trafic graphs are empty. It's been running for 24 hours now so I expected to see something.

It's a new system setup, so likely I am missing a system or php package that the trafic plugin needs to run? I got the geoip plugin and everythign going eventually, trafic is the only one not working.
 

jith45

Member
May 25, 2018
960
0
16
Ok, I lied.

When I thought i had chmod 777'd everything, i had really only given "7" permissions to apache, not to the rtorrent user. I aplogise. Fixing this has fixed it.

I would still like info about having rtorrent exec the update.php script. E.g. why people are doing it, and what does it do, is there some docs about it i can read.

thanks for the help!
 

das329717

Member
May 25, 2018
928
0
16
Which file permissions in particular?
Web-server user must have read permissions for all files inside rutorrent folder. And it must have execute permissions for all *.sh files inside rutorrent folder.
rtorrent user must have read permissions for all files inside rutorrent folder. And it must have execute permissions for all *.sh files inside rutorrent folder.
Web-server and rtorrent user must have read+write permissions to rutorrent/share directory (and to all files/folders inside it).
There are no errors
Yet once - PASTE MORE INFO. I'm not a telepat. I give to you a template, is you understand it?
Which version of ruTorrent you is use? What about rtorrent version?
 

dsouvik215

Member
May 25, 2018
896
0
16
Web-server and rtorrent user must have read+write permissions to rutorrent/share directory (and to all files/folders inside it).
This was my problem. I did the following when i originally setup rutorrent

chown -R rtorrent share/
chmod -R g+w share/
chgrp -R apache share/

giving apache and rtorrent write permissions, to share, since apache is the group owner

However, after further investigation, what happens is rutorrent (the php, so apache user) creates folders inside the share/ folder, for each user such as "tom" or whatever, then inside there it creates various folders for settings and data for the plugins etc. Since these folders were created by apache user, they are OWNED by the apache user, hence rtorrent will not have write access to these folders that rutorrent has now created AFTER your initial setup.

So the solution is, have a cron that runs the 3 above chown/chmod/chgrp commands so the 2 users will always have correct access regardless of who created the files/folders. Or blanket 777 for everything. I believe the later to be overkill as I use my server for a lot more than rtorrent and dont want to compromise it.

One more solution I just thought of that is a bit tricky, is to add the rtorrent user to the "apache" group in /etc/group, so if folders are writable by apache group, then rtorrent will also able to write there.

Thanks for helping me track it down Novik and I apologise for wasting your time. But if possible, could I get some info on the update.php scripts as mentioned earlier? I am curious to know what I might gain by adding it in like other users on this forum have done.
 

shwetha17

Member
May 24, 2018
785
0
16
you don't have to have everything 777. you just need to set up ownership correctly, it's not that difficult.

755 works for almost everything.
 

somus1735

Member
May 25, 2018
833
0
16
you don't have to have everything 777. you just need to set up ownership correctly, it's not that difficult.

755 works for almost everything.
Correct, "almost" everything. And that's assuming the "owner" of the files is the apache (or webserver) user, since the first 7 applies to owner.

The "almost" part is incorrect for the traffic plugin, since it requires the rtorrent user have write access inside of share/users/<username>/settings/ so that i can routinely dump the traffic statistics in there.

You should be safe to 755 everything except that share/ folder, which you will have to chmod 775 and make sure the rtorrent user and the webserver user are in the same group, so the second 7 (the group) has write access.

And you should probably do that last chmod AFTER you've already logged into your rutorrent at least once, since that share/users/<username>/settings folder won't actually exist until you've logged in the first time, and will get created with wrong permissions.
 

jith45

Member
May 25, 2018
960
0
16
Correct, "almost" everything. And that's assuming the "owner" of the files is the apache (or webserver) user, since the first 7 applies to owner.

The "almost" part is incorrect for the traffic plugin, since it requires the rtorrent user have write access inside of share/users/<username>/settings/ so that i can routinely dump the traffic statistics in there.

You should be safe to 755 everything except that share/ folder, which you will have to chmod 775 and make sure the rtorrent user and the webserver user are in the same group, so the second 7 (the group) has write access.

And you should probably do that last chmod AFTER you've already logged into your rutorrent at least once, since that share/users/<username>/settings folder won't actually exist until you've logged in the first time, and will get created with wrong permissions.
lol, no.

let me put this another way.
root can own everything in it's default permissions with the EXCEPTION of rutorrent/share/ (and it's subdirectories and files)

The only other exception to this rule that i know of is the autodl-irssi plugin, but it functions a little differently than most of the plugins.

Take it from someone who has set up hundreds of rutorrent installs. a standard install procedure for me is to check out the source via svn, edit the config files accordinly and do a single chown -R www:www (or apache:apahce or http:http depending on the os to the rutorrent/share/ directory.

the default permissioms are fine, and rutorrent is coded in suhc a way to create files with the proper ownership/permissionm in share provided it has the original means to do so.
 

das329717

Member
May 25, 2018
928
0
16
the default permissioms are fine, and rutorrent is coded in suhc a way to create files with the proper ownership/permissionm in share provided it has the original means to do so.
But the problem is rutorrent doesn't create the files in share/users/<username>/settings/traffic/*.csv, rtorrent does. Happy to be corrected, but I 777'd my share/users/tigris/settings folder as a whole and the files in the traffic folder are owned/grouped to my rtorrent user and NOT the apache user, which can only mean rtorrent created them! Note: I am ONLY talking about the traffic plugin, nothing else. All other plugins files created etc are correctly owned by apache user.

In any case, all this arguing is irrelevant to my intial topic post which is to simply get an understand of what adding the following to your .rtorrent.rc would be for:

schedule = rss,0,900,"execute={sh,-c,php /var/www/rutorrent/plugins/rss/update.php & exit 0}"

There is nothing on the rutorrent wiki about needing to do such a thing or what it would do, but on the forums here many people have said it fixes whatever problems they had, without knowing why. I don't have any problems currently, but still curious.
 

dsouvik215

Member
May 25, 2018
896
0
16
In any case, all this arguing is irrelevant to my intial topic post which is to simply get an understand of what adding the following to your .rtorrent.rc would be for:

schedule = rss,0,900,"execute={sh,-c,php /var/www/rutorrent/plugins/rss/update.php & exit 0}"

There is nothing on the rutorrent wiki about needing to do such a thing or what it would do, but on the forums here many people have said it fixes whatever problems they had, without knowing why. I don't have any problems currently, but still curious.
What this does is updating the RSS feed (even without the webui being opened , so very handy if for example your seedbox restarts when you are sleeping)
 

shwetha17

Member
May 24, 2018
785
0
16
What this does is updating the RSS feed (even without the webui being opened , so very handy if for example your seedbox restarts when you are sleeping)
Tanks rascalli, so is essentially the same as:

execute = {sh,-c,/usr/bin/php /var/www/rutorrent/php/initplugins.php <username> &}

Except it will only "init" the rss plugin instead of *all* plugins? I.e. there is no reason to have both executes?
 

dsouvik215

Member
May 25, 2018
896
0
16
In any case, all this arguing is irrelevant to my intial topic post which is to simply get an understand of what adding the following to your .rtorrent.rc would be for:

schedule = rss,0,900,"execute={sh,-c,php /var/www/rutorrent/plugins/rss/update.php & exit 0}"
this is deprciated. use initplugins.php instead.