running the updater in a detached screen

If you run tt-rss on an officially unsupported platform (shared hosting, Windows, etc.) post here
happyuser
Bear Rating Trainee
Bear Rating Trainee
Posts: 6
Joined: 25 Nov 2011, 14:03

running the updater in a detached screen

Postby happyuser » 01 Jul 2013, 11:08

Hi all,

I am aware of the faq saying shared hosting is not supported. Furthermore, my question might well be not related to ttrss directly. Still, I hope it is interesting enough to get some attention here. Feel free to tell me to go somewhere else with it.

Anyway, here is my question:
I upgraded (skipped many versions) to the current version from git this weekend. I was using cron jobs for the updating before. Reading again about updating feeds I tried the update daemon this time.

I started this in a screen:
> /usr/php/53/usr/bin/php-cli ./update_daemon2.php
And it works great as long as I stay logged in. As soon as I detatch the screen and log out, the updating does not work. The gui complains about it and in the screen I get lots of messages of the form:
Unable to connect to database (as <dbusername> to localhost, database <dbname>): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)Unable to connect to database (as <dbusername> to localhost, database <dbname>): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)[05:24:30/24910] [reap_children] child 12646 reaped.


Once I log in again and re-attach the screen, everything works fine again.

Is that a known problem? And is there a solution? In the meantime I switched back to the cron job, which does work.

Thanks in advance for any help

tbar
Bear Rating Trainee
Bear Rating Trainee
Posts: 18
Joined: 16 Apr 2013, 09:39

Re: running the updater in a detached screen

Postby tbar » 01 Jul 2013, 11:26


User avatar
sleeper_service
Bear Rating Overlord
Bear Rating Overlord
Posts: 884
Joined: 30 Mar 2013, 23:50
Location: Dallas, Texas

Re: running the updater in a detached screen

Postby sleeper_service » 01 Jul 2013, 11:32

tbar wrote:http://tt-rss.org/redmine/projects/tt-rss/wiki/UpdatingFeeds
is there something in there that's supposed to be relevant to the OP's question? I missed it.

User avatar
sleeper_service
Bear Rating Overlord
Bear Rating Overlord
Posts: 884
Joined: 30 Mar 2013, 23:50
Location: Dallas, Texas

Re: running the updater in a detached screen

Postby sleeper_service » 01 Jul 2013, 11:36

happyuser wrote:I started this in a screen:
> /usr/php/53/usr/bin/php-cli ./update_daemon2.php
And it works great as long as I stay logged in. As soon as I detatch the screen and log out, the updating does not work. The gui complains about it and in the screen I get lots of messages of the form:
Unable to connect to database (as <dbusername> to localhost, database <dbname>): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)Unable to connect to database (as <dbusername> to localhost, database <dbname>): Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)[05:24:30/24910] [reap_children] child 12646 reaped.


Once I log in again and re-attach the screen, everything works fine again.

Is that a known problem? And is there a solution? In the meantime I switched back to the cron job, which does work.

Thanks in advance for any help


that doesn't *sound* like it has anything to do with ttrss, it sounds like there's something weird on your system wrt screen.

try running the daemon and then detach from the screen for a bit, watch the log file. if you start getting errors, then there's some problem either in the way you're using screen or the way it's set up. if you don't get errors, then log out for a few, and see if you get errors then.

in other words, collect more data.

I've used screen for the daemon in the past, currently I'm nohupping it ie: nohup ./update_daemon2.php --tasks=8 --quiet &

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: running the updater in a detached screen

Postby fox » 01 Jul 2013, 11:43

That's definitely not how screen is supposed to work. Maybe your hosting modified it to stop child processes if detached (or maybe it's an option which they have enabled)?

Edit: mysql errors? Strange. This looks like a hosting thing to me. Try getting a proper VDS.

happyuser
Bear Rating Trainee
Bear Rating Trainee
Posts: 6
Joined: 25 Nov 2011, 14:03

Re: running the updater in a detached screen

Postby happyuser » 01 Jul 2013, 12:50

Hi all,

and thanks for the quick responses. I agree that it is probably a hosting thing. I also agree, that a proper VDS would be a better option.

To the actual problem at hand. I collected another data point: I also tried nohup instead of screen. The exact same thing happens. When I log out, the nohup.out fills with the mysql errors. As soon as I log in again, the updater works again.

I guess, I should report to my hosting service and see what they say, correct? (Yes, I should move away from shared hosting)

User avatar
Louie
Bear Rating Trainee
Bear Rating Trainee
Posts: 13
Joined: 26 Jun 2013, 18:14

Re: running the updater in a detached screen

Postby Louie » 02 Jul 2013, 23:49

Some hosting providers will allow you to run screen in a shared environment, but will kill any processes running from a terminal window after you log out. That sounds like what is happening to you.


Return to “Unsupported platforms”

Who is online

Users browsing this forum: No registered users and 1 guest