RSS Automatic Updates

somus1735

Member
May 25, 2018
833
0
16
Hi All,

Minor issue! I've setup ruTorrent ok so far, and Have a feed setup - along with my filters. If I manually update the feed, all is dandy.

However - automatic updates are failing.

If I run;
su -c 'php /usr/local/share/rutorrent/plugins/rss/update.php'

I recieve:
PHP Warning: mkdir(): No such file or directory in /usr/local/share/rutorrent/php/cache.php on line 12

This is the same error that's returned in the rTorrent log file.

I've tried running this under root to try and rule out permission errors too.

I've checked permissions on the share folder, and on the update.php file.

Any idea what's up?

Thanks!
 

jith45

Member
May 25, 2018
960
0
16
make sure your rutorrent files under SHARE are all writable to the webusers.

if you're rutorrent webroot is /usr/local/www/rutorrent/

you'll want to either chmod -R 777 /usr/local/www/rtorrent/share/

or

chown -R webuser:webuser /usr/local/www/rtorrent/share/

so if it's rpath i THINK the web user is web so it would be chown -R web:web /whatever/the/path/is/share
 

das329717

Member
May 25, 2018
928
0
16
Tried;

chmod 777 /usr/local/share/rutorrent/share -R

and

chown apache:apache /usr/local/share/rutorrent -R

Both of which applied. I've double checked the permissions on this structure and it's taken; still getting the error though. It's as if it's trying to create a folder in a non-existing location?
 

dsouvik215

Member
May 25, 2018
896
0
16
If this helps, the user "apache" is the web user. And my rTorrent runs under the username "rtorrent".
 

shwetha17

Member
May 24, 2018
785
0
16
I think I may have found a bug.

I'm not running multi user - but I have locked down my rutorrent site using apache directives.

I noticed that rutorrent automatically created the rutorrent/share/users/username/settings/rss/cache folder (along with everything else) for me - which is great. The "username" folder it created was the same name as the username I required for my apache setup - which again, was great.

With the above in mind - I tried to echo out the folder that cache.php was complaining about, and sure enough - it was looking in the /rutorrent/share/settings/ folder - instead of the specific user folder structure.

So i'm wondering if there's a bug with the multi-user setup within update.php.
 

somus1735

Member
May 25, 2018
833
0
16
it's not a bug at all. If you use authentication, you are effectively using multi-user mode whether or not it's a single user or not.

as such, the same rules apply.

meaning, the web users needs to be writable to

rutorrent/share/users/USERNAME/torrents/

and
rutorrent/share/users/USERNAME/settings/


where rutorrent is your rutorrent files, where USERNAME is the login name for your auth.


edit:

rereading your error, i think i see the problem.

Don't call the rss script, instead call php/initplugins.php with a username that you auth with.

liek this:

Code:
execute = {sh,-c,/usr/bin/php rutorrent/php/initplugins.php USERNAME &}

and set your rss plugin to correct settings in the conf file.



or if you must call the rss script, try passing it the webauth username.
 

jith45

Member
May 25, 2018
960
0
16
I think I just figured it out as you wrote that cheesy.gif

I didn't use the initplugins script, I continued to use the update.php script - but instead passed it the web username as the first argument. I'm not sure if it's working, but it's not returning an error anymore.

So - instead of.
Code
execute = {sh,-c,/usr/bin/php /usr/local/share/rutorrent/plugins/rss/update.php& exit 0}
it becomes

Code:
execute = {sh,-c,/usr/bin/php /usr/local/share/rutorrent/plugins/rss/update.php username& exit 0}
 

dsouvik215

Member
May 25, 2018
896
0
16
the best way to see if it is working is to do this:

set it to 1 minute

and keep calling ps as that user and look for the php command.

There is also a way to call an execute log, but i forget the exact syntax for 0.8.6

I'll find it for you.


edit:

log.execute = /some/file/somewhere.log

in the .rtorrent.rc


also, i am fairly sure the rss script uses /tmp to cache data so you may be able to see it work that way as well
 

shwetha17

Member
May 24, 2018
785
0
16
I have the log setup already - and it's showing a success on running it. So I presume all is well at this point.

You might want to update your howto for multi-user setups - I don't think you mention this requirement in there - might help someone else out in the future. smiley.gif
 

somus1735

Member
May 25, 2018
833
0
16
yah, that's because it's really not a REQUIREMENT of multi-user, but it is a gotcha so it does merit a blurb
 

jith45

Member
May 25, 2018
960
0
16
So - after a day of running - I've noticed something odd;

In my rtorrent.log file, I see;

Code:
---
sh -c php /usr/local/share/rutorrent/plugins/rss/update.php admin& exit 0
---

--- Success ---

And after that....

Code:
---
sh -c '/usr/bin/php' '/usr/local/share/rutorrent/plugins/rss/update.php' 'admin' & exit 0
---

--- Success ---

So it appears that the update is running twice. Once from the schedule I setup in the .rc file, and the second from the ruTorrent website itself.

Is this normal? Is there a way to disable the website on if It means my RSS feed is getting hit double the amount it should?

In the conf.php file for the RSS plugin, I tried adding the $isAutoStart = false; to no avail.

Should I just ignore this? smiley.gif
 

das329717

Member
May 25, 2018
928
0
16
yes, you should ignore it.

It's just how the log works.


(the log in rtorrent has no way of knowing what happens in rutorrent)
 

somus1735

Member
May 25, 2018
833
0
16
.rtorrent.rc:

Code:
# Maximum and minimum number of peers to connect to per torrent.
#min_peers = 40
max_peers = 180

# Same as above but for seeding completed torrents (-1 = same as downloading)
#min_peers_seed = 10
max_peers_seed = 52

# Maximum number of simultanious uploads per torrent.
max_uploads = 6

# Global upload and download rate in KiB. "0" for unlimited.
download_rate = 1500
upload_rate = 17

# Default directory to save the downloaded torrents.
directory = /mnt/primary/data/torrents/downloads

# Default session directory. Make sure you don't run multiple instance
# of rtorrent using the same session directory. Perhaps using a
# relative path?
session = /home/rtorrent/.session

# Close torrents when diskspace is low.
schedule = low_diskspace,5,60,close_low_diskspace=100M

# Port range to use for listening.
port_range = 51413-51413

# Start opening ports at a random position within the port range.
port_random = no

# Check hash for finished torrents. Might be usefull until the bug is
# fixed that causes lack of diskspace not to be properly reported.
check_hash = no

# Set whetever the client should try to connect to UDP trackers.
use_udp_trackers = yes

# Encryption options, set to none (default) or any combination of the following:
# allow_incoming, try_outgoing, require, require_RC4, enable_retry, prefer_plaintext
#
# The example value allows incoming encrypted connections, starts unencrypted
# outgoing connections but retries with encryption if they fail, preferring
# plaintext to RC4 encryption after the encrypted handshake
#
encryption = allow_incoming,try_outgoing,enable_retry

# Enable DHT support for trackerless torrents or when all trackers are down.
# May be set to "disable" (completely disable DHT), "off" (do not start DHT),
# "auto" (start and stop DHT as needed), or "on" (start DHT immediately).
# The default is "off". For DHT to work, a session directory must be defined.
#
dht = disable

# Enable peer exchange (for torrents not marked private)
peer_exchange = no

# SCGI Port to use.
scgi_port = localhost:5001

# Force encoding to UFT-8
encoding_list = UTF-8

# Enable Logging
log.execute = /home/rtorrent/rtorrent.log

# Schedule our RSS Updates.
schedule = rss,0,00:10:00,"execute={sh,-c,/usr/bin/php /usr/local/share/rutorrent/plugins/rss/update.php admin & exit 0}"

# Enable our Block Lists.
ip_filter = /home/rtorrent/.blocklists/bt_level1
schedule = filter,05:00:00,24:00:00,reload_ip_filter=

And a snippet from my rtorrent.log file:

Code:
---
sh -c '/usr/bin/php' '/usr/local/share/rutorrent/plugins/trafic/update.php' 'admin' & exit 0
---

--- Success ---

---
sh -c '/usr/bin/php' '/usr/local/share/rutorrent/plugins/rss/update.php' 'admin' & exit 0
---

--- Success ---

---
sh -c /usr/bin/php /usr/local/share/rutorrent/plugins/rss/update.php admin & exit 0
---

--- Success ---

---
sh -c '/usr/bin/php' '/usr/local/share/rutorrent/plugins/trafic/update.php' 'admin' & exit 0
---

--- Success ---

---
sh -c '/usr/bin/php' '/usr/local/share/rutorrent/plugins/rss/update.php' 'admin' & exit 0
---

--- Success ---

---
sh -c /usr/bin/php /usr/local/share/rutorrent/plugins/rss/update.php admin & exit 0
---

--- Success ---

---
sh -c '/usr/bin/php' '/usr/local/share/rutorrent/plugins/scheduler/update.php' 'admin' & exit 0
---

--- Success ---

---
sh -c '/usr/bin/php' '/usr/local/share/rutorrent/plugins/rss/update.php' 'admin' & exit 0
---

--- Success ---

---
sh -c /usr/bin/php /usr/local/share/rutorrent/plugins/rss/update.php admin & exit 0
---

--- Success ---

---
sh -c '/usr/bin/php' '/usr/local/share/rutorrent/plugins/trafic/update.php' 'admin' & exit 0
---

--- Success ---

---
sh -c '/usr/bin/php' '/usr/local/share/rutorrent/plugins/rss/update.php' 'admin' & exit 0
---

--- Success ---

---
sh -c /usr/bin/php /usr/local/share/rutorrent/plugins/rss/update.php admin & exit 0
---

--- Success ---

---
sh -c '/usr/bin/php' '/usr/local/share/rutorrent/plugins/trafic/update.php' 'admin' & exit 0
---

--- Success ---

---
sh -c '/usr/bin/php' '/usr/local/share/rutorrent/plugins/rss/update.php' 'admin' & exit 0
---

--- Success ---

---
sh -c /usr/bin/php /usr/local/share/rutorrent/plugins/rss/update.php admin & exit 0
---

--- Success ---

---
sh -c '/usr/bin/php' '/usr/local/share/rutorrent/plugins/rss/update.php' 'admin' & exit 0
---

--- Success ---

---
sh -c /usr/bin/php /usr/local/share/rutorrent/plugins/rss/update.php admin & exit 0
---

--- Success ---

You'll notice one of the lines in the log file is from the schedule line in my rtorrent.rc file. Another line in the log is provoked by rutorrent I think.

On another note, i'm wondering if this is related to;

If I keep rutorrent open for a while - I notice the if I click into the feed I have setup, the list isn't updated. If I refresh the screen - the list is then updated with the actual updates. It's as if the GUI doesn't update the list of items in a feed.
 

somus1735

Member
May 25, 2018
833
0
16
# Schedule our RSS Updates.
schedule = rss,0,00:10:00,"execute={sh,-c,/usr/bin/php /usr/local/share/rutorrent/plugins/rss/update.php admin & exit 0}"
1) You doesn't need to start each plugin separately. You must use common plugin start, in such way:

execute = {sh,-c,/usr/bin/php /usr/local/share/rutorrent/php/initplugins.php admin &}

2) If you want to start plugin rss only (for some, unknown for me reason) you must use line

schedule = rssadmin,0,00:10:00,"execute={sh,-c,/usr/bin/php /usr/local/share/rutorrent/plugins/rss/update.php admin & exit 0}"
 

jith45

Member
May 25, 2018
960
0
16
Hi Novik,

Thanks for this. One question remains;

If I start the plugins this way - should I still schedule it for 10 minutes? I.e, I need my RSS to check every 10 minutes, so do I still schedule ALL plugins to re-initialize every 10 minutes using your example below?

Regards,

--
Cad
 

das329717

Member
May 25, 2018
928
0
16
Actually - I think I understand what you mean.

I REMOVE the following lines in my rTorrent.rc file:
Code:
# Schedule our RSS Updates.
schedule = rss,0,00:10:00,"execute={sh,-c,/usr/bin/php /usr/local/share/rutorrent/plugins/rss/update.php admin & exit 0}"

And replace them with the following:
Code:
# Start our ruTorrent Plugins.
execute = {sh,-c,/usr/bin/php /usr/local/share/rutorrent/php/initplugins.pp admin &}

What this does, is ensures that upon starting rTorrent - all ruTorrent plugins are initialised. This then makes sure the RSS plugin is running, and it looks after updates itself via its update Interval as set in the conf.php for the plugin itself.

So the plugin takes care of 10 minute refreshes - whereas the rTorrent.rc only makes sure the plugin is running on START.
 

dsouvik215

Member
May 25, 2018
896
0
16
heh - Could be wrong though. After trying this, I only get one entry in my log file. So it would appear I'd have to schedule it for every 10 minutes rather than invoking it once.