If you want to daemonize a script created with node.js.
For example, if you want a program like screenshot-as-a-service to reside on the server.
Let's use forever.
Monitor the life and death of the node.js script that you started, and restart it automatically if it stops.
npm install forever-g
forever start spp.js
Stop or restart a running script
forever stop
forever stopall
forever restart
How about creating a unit file for systemd
(although I'm not familiar with node.js)?
I think it's better to manage it using pm2.The reason is that Node.js supports clustering mode or not at the language level, so I think it would be appropriate to use pm2 as a framework to absorb it.
I don't think the pm2 process itself is likely to die if left alone, but if we do our best, I think it would be better to daemonize pm2 itself at the OS level with systemd, as Hayao Yamada said.
340 Memory layouts learned in theory don't work out as expected when actually printed as addresses.
371 Update Flask User Information
339 Understanding the Meaning of mpm prefork Settings
356 I want to create an array of sequences from "1" to a specified number.
353 I have saved several codes written in python to a visual studio file.
© 2023 OneMinuteCode. All rights reserved.