3 ms·
On the command line, take a look at "nohup". Programmatically, read about how to "daemonize" (which involves calling fork() twice). And if you actually want t
by JoshTriplett 10y ago
On the command line, take a look at "nohup". Programmatically, read about how to "daemonize" (which involves calling fork() twice). And if you actually want to run a server more persistently (not just keep a process running that you launched from SSH), modern init systems (such as systemd) make that easy to do by handling daemonization for you, such that your code doesn't need to do anything special.
- ge96 10y agoCool, thanks a lot at least I have a direction to look. Yeah it's just odd to me since I haven't done something like this before, how you keep something running that isn't on the public/client-triggered side. edit: Actually a while back I did do a socket.io tutorial where you triggered the process by terminal. Not sure if directly related, node was mentioned below. I just wonder if you left the terminal would it end. Obviously not I don't think since this is in practice now on the web and I doubt they just have terminals open to keep a process running.