-
Notifications
You must be signed in to change notification settings - Fork 944
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
Dreamhost Cron Job not restarting Forever #58
Comments
I went ahead and started the same script in bash, and the script successfully finds the forever command, but not node: /usr/bin/env: node: No such file or directory Anyone have an ideas? |
@spadeworkers: your individual user account seems to have a node path set in your bash environment, but the user trying to run the cron job, sometimes a separate Let me know if this is still a problem or if you have other questions. |
Thanks for the response. I realize I should have added the -c argument to the command adding the full path to the node app. Though even after I did that I am still getting the node error. Even the list command returns the same error. The command I'm running is: /usr/local/lib/node/.npm/forever/0.4.1/package/bin/forever -v -c /home/xxxxx/node/node list Error is: /usr/bin/env: node: No such file or directory Its as if the -c argument is not working. |
@spadeworkers The I'm not sure the best way to make this run across multiple possible node locations. @AvianFlu do you know if its possible to replace: #!/usr/bin/env node with something like: #!which node |
@indexzero: it would have to be |
@AvianFlu This doesn't seem to work. I modified and linked my local forever and tried $ forever list
/usr/local/bin/node
/usr/local/bin/forever |
@spadeworkers I believe I have found a solution to your problem. Can you try running $ node `which forever` list I'm not sure the right approach to fixing this in forever core. A comment from anyone with serious bash-fu would be welcome. |
I have encountered the same -
|
Having one's absolute |
@indexzero I ran the command you suggested:
and it works fine from the command line, but then I had this run from the cron:
and I get this error:
'/home/xxxxx/' is the home folder for the user under which the cron job is running |
This should be fixed in the |
I have a cronjob set up on my Dreamhost vps account to check if node.js is running a specific script with Forever. The cron first loads the user environment by loading the /path/to/.bash_profile, then runs the php script which checks to see if forever is running the given node.js script: /path/to/check_node_app.php -s application_search.js. This php script runs the shell command forever list, checks for the script, then runs forever start if its not running. (the main reason for creating this script is because forever shut down once, maybe due to server reboot??)
software versions:
forever: 0.4.1
node: v0.4.4
npm: 0.3.15
OS: Linux ps39832 2.6.33.7-vs2.3.0.36.30.4 #23 SMP Tue Sep 28 05:47:35 PDT 2010 x86_64 GNU/Linux
It works perfectly if I run the php script from the command line of that user, but from the cron job, it spits out the error:
sh: forever: command not found
Then if I put the full path to forever in the script /usr/local/lib/node/.npm/forever/0.4.1/package/bin/forever I get this error:
sh: forever: command not found
/usr/bin/env: node: No such file or directory
I chose php for the script basically because I know php and not bash very well, though if this causes part of the issue I am fine to learn how to do it in bash. If there is nothing off the bat here that seems obvious is the issue, I'll update forever as Charlie suggested in an email from him.
The text was updated successfully, but these errors were encountered: