Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a restart for hosting that kills user processes #14

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Sustenance
Copy link

Some shared hosting, such as Namecheap, will periodically kill off users' processes. This should allow the process to be restarted when a request comes in while the process is dead.

@Sustenance
Copy link
Author

Actually, don't merge this yet. I need to add a check that the node PID is still alive - just realized that it wasn't actively checking that on each serve

@niutech
Copy link
Owner

niutech commented Mar 2, 2016

Thank you for your contribution. Could you please add spaces around { }? And I am not sure if checking for $node_pid in the if statement is necessary. Finally, is there a need to run node_serve recursively, instead of just continuing to curl_init?

@Sustenance
Copy link
Author

I can make the requested changes. I called node_serve recursively so that it would redo the check for the PID.
Unfortunately, between yesterday and today, my hosting provider seems to be killing this node process immediately, so this is causing a race condition.
Have you seen that at all, where node is started successfully via node.php, but an immedate ps -e doesn't show the PID? Manually starting node via SSH works fine

@niutech
Copy link
Owner

niutech commented Mar 2, 2016 via email

@Sustenance
Copy link
Author

Sorry I let this PR die. The host I was using (NameCheap) has an autokiller on its shared hosting apparently, and kills node as soon as it starts. Doesn't look like I'll be able to continue contributing.

TheTechsTech added a commit to TheTechsTech/node.php that referenced this pull request Sep 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants