forever

Node Server crashes after few hours

穿精又带淫゛_ 提交于 2019-11-29 02:34:46
I am using Nodemon with Forever Module on Ubuntu Server. I use this command to start my Node Server: forever start -c nodemon app.js --exitcrash It works fine for few hours (approx 48 Hours), but after that my Server stops working with these errors: Error: getaddrinfo EMFILE TypeError: Cannot call method 'indexOf' of undefined Error: Handshake inactivity timeout These errors are caused due to Exceeding Limit of Open Files/Sockets . Now my question is: Can I use -m (Which sets to unlimited in my Operating System): max memnory size (kbytes, -m) unlimited Should I use the above command with -m?

node.js processes with the same name in forever are closed when trying to close only one

半腔热情 提交于 2019-11-29 01:35:31
I am deploying two node.js apps on the aws, the two apps are in the paths shown as /home/ubuntu/nodes/app1/app.js /home/ubuntu/nodes/app2/app.js respectively to run the node.js apps in the background, I used forever to start two apps, so like $ sudo forever start /home/ubuntu/nodes/app1/app.js $ sudo forever start /home/ubuntu/nodes/app2/app.js so forever works well by running the two node.js apps in the background process. However, when I tried to stop one process with forever command like this. $ sudo forever stop /home/ubuntu/nodes/app1/app.js unexpectedly, both node.js process are closed

How to run pm2 so other server users are able to access the process?

烂漫一生 提交于 2019-11-28 20:52:40
问题 When I start my Nodejs app with pm2, other server users are not able to access the process. Even if I start pm2 from a custom directory (not current user's ~/ , what pm2 is using by default): HOME=/var/www pm2 start app.js Directory is accessible by any user (comparing to ~/ , but there's still no way other server user is able to access the process. When other server user does pm2 list , it shows him 0 processes are running – but there are (started by another user). And when other user tries

How to pass arguments to app using pm2?

断了今生、忘了曾经 提交于 2019-11-28 16:29:09
I am using pm2 to start my app but i am not able to pass argument to it. the command I am using is pm2 start app.js -- dev. Though this works with forever. You can do as stated in this ticket: https://github.com/Unitech/pm2/issues/13 Though if you're passing the environment you may want to consider leveraging environment variables. With this you create a variable which can be accessed by any process in that environment with process.env.* . So you have a configuration file config.json : { "dev": { "db": { "hosts":["localhost"], "database": "api" }, "redis": { "hosts": ["localhost"] } },

Node forever /usr/bin/env: node: No such file or directory

孤人 提交于 2019-11-28 03:10:34
I have installed nodejs using: apt-get install nodejs Then i have installed npm using: apt-get install npm And then i have installed forever using: npm install forever -g Now i go to my project /var/www/myproject and attempt to run forever start server.js then i get the following message: /usr/bin/env: node: No such file or directory Can anyone tell me whats going on? EDIT: As of December 2018, this is no longer the correct way. See the other two answers. You need to symlink the nodejs executable to node sudo ln -s "$(which nodejs)" /usr/local/bin/node The reason for this is that when you do

Forever + Nodemon running together

非 Y 不嫁゛ 提交于 2019-11-28 02:57:28
Is there any way to have both of this packages running together? So basically I want to have best from both worlds. Running server automatically (and restarting when there is an error) and also automatic updates when there is .js file change happening. Jubair Toxa was on the right track, the issue that cfogelberg raised is valid, but to avoid that issue you can do the following: forever -c "nodemon --exitcrash" app.js this makes sure nodemon actually exits (rather than giving you the "app crashed" message) and then forever picks it up again. In forever --help this -c specifies a command to run

Where does forever store console.log output?

老子叫甜甜 提交于 2019-11-27 17:16:31
I installed forever and am using it, finding it quite funny. But I realized that the logs are placed to somewhere else. Is there any tips? Forever takes command line options for output: -l LOGFILE Logs the forever output to LOGFILE -o OUTFILE Logs stdout from child script to OUTFILE -e ERRFILE Logs stderr from child script to ERRFILE For example: forever start -o out.log -e err.log my-script.js See here for more info Forever, by default, will put logs into a random file in ~/.forever/ folder. You should run forever list to see the running processes and their corresponding log file. Sample

node.js processes with the same name in forever are closed when trying to close only one

吃可爱长大的小学妹 提交于 2019-11-27 16:05:22
问题 I am deploying two node.js apps on the aws, the two apps are in the paths shown as /home/ubuntu/nodes/app1/app.js /home/ubuntu/nodes/app2/app.js respectively to run the node.js apps in the background, I used forever to start two apps, so like $ sudo forever start /home/ubuntu/nodes/app1/app.js $ sudo forever start /home/ubuntu/nodes/app2/app.js so forever works well by running the two node.js apps in the background process. However, when I tried to stop one process with forever command like

How to pass arguments to app using pm2?

随声附和 提交于 2019-11-27 09:44:44
问题 I am using pm2 to start my app but i am not able to pass argument to it. the command I am using is pm2 start app.js -- dev. Though this works with forever. 回答1: You can do as stated in this ticket: https://github.com/Unitech/pm2/issues/13 Though if you're passing the environment you may want to consider leveraging environment variables. With this you create a variable which can be accessed by any process in that environment with process.env.* . So you have a configuration file config.json : {

How to have css3 animation to loop forever

拟墨画扇 提交于 2019-11-27 07:45:05
I want to have the whole set of animation to play forever. When the last photo fades off, I want the first one to appear again an so on. What I did (and I dont like) is set the page to reload at the end of the last photo fade out. Is there any other way to do this using css??? <html> <head> <style> .content{ height: 400px !important; /*margin: auto !important;*/ overflow: hidden !important; width: 780px !important; } .imgholder{ height: 400px; margin: auto; width: 780px; } .photo1{ opacity: 0; animation: fadeinphoto 7s 1; -moz-animation: fadeinphoto 7s 1; -webkit-animation: fadeinphoto 7s 1;