Page 1 of 1

Update feed script on Amazon Linux AWS

Posted: 24 Nov 2015, 00:48
by mcdragon
Hi

I have used tt-rss before but used cron. Now trying to use the preferred option of using the update daemon as described here: https://tt-rss.org/gitlab/fox/tt-rss/wikis/UpdatingFeeds.
I am using Amazon Linux which is based on Redhat. I have tried using the rc.local file to start the deamon at boot time but am unable to start it.

I have tried

Code: Select all

php /var/www/html/tt-rss/update.php --daemon &

and

Code: Select all

su --shell=/bin/bash ec2-user -c “nohup /var/www/html/tt-rss/update.php --daemon > /dev/null &”


Can't get it to work. When I run the first command by itself it is fine but it won't update the feeds by itself. I have restarted the server. The PHP_EXECUTABLE is set correctly.

Any ideas?

Re: Update feed script on Amazon Linux AWS

Posted: 24 Nov 2015, 13:16
by darknite323
I don't know much about RedHat but here's a few things to try.

With the first command, perhaps it needs the full path to the php app.
Maybe change it to:

Code: Select all

/usr/bin/php /var/www/html/tt-rss/update.php --daemon &

Obviously change it if php runs from a different directory on RedHat, this is the path from my Ubuntu test system.

As for the second command, if it's not working by itself then it's likely not correct.
I believe that you need php after nohup, so:

Code: Select all

su --shell=/bin/bash ec2-user -c “nohup php /var/www/html/tt-rss/update.php --daemon > /dev/null &”

Also might need the full path to php in there. But this one is a bit out of my league so I could be way off.

If nothing works then try out this reply from stackoverflow:
http://stackoverflow.com/a/13722274
So you can get a log of what's happening in rc.local on boot.

Re: Update feed script on Amazon Linux AWS

Posted: 24 Nov 2015, 13:24
by fox
also why not run without dev/null and nohup and shit so you would have some actual output to read through instead of staring at blank screen wondering what went wrong

Re: Update feed script on Amazon Linux AWS

Posted: 24 Nov 2015, 14:23
by cktt
I have CentOS (similar to RedHat), in /etc/init.d I have a script with

Code: Select all

daemon --user=apache /usr/bin/php /var/www/ttrss/update_daemon2.php > /var/log/ttrss 2>&1 &

Re: Update feed script on Amazon Linux AWS

Posted: 30 Nov 2015, 22:42
by mcdragon
Got it to work using various suggestions. cktt, I couldn't get that working as I was getting an error on the deamon command.
when using fox's suggestions I removed some of the parameters and one of the problems was that I was running it as root which is a no no. This was the solution that worked as I execute the command as the default user on Amazon Linux which is "ec2-user". This is basically why this ..

Code: Select all

/usr/bin/php /var/www/html/tt-rss/update.php --daemon &
DID NOT work.

The current command in my rc.local that is working so far is

Code: Select all

su -m ec2-user -c "/usr/bin/php /var/www/html/tt-rss/update_daemon2.php --feeds --quiet --log /var/www/html/tt-rss/ttrss.log > /var/log/ttrss 2>&1"

The suggestions to put full paths in here are valid but did not make any difference on my system as the php command is global.
Once the sync is stable I will remove the log outputs.

Also I would suggest monitoring the "CPUUtilization" and "CPUCreditBalance" metrics in CloudWatch to keep on eye of resource hogging.
Thanks for all the help and suggestions guys. Much appreciated.