In a remote CentOS VM Geddy application with MonogoDB wrapper is deployed. The application starts and listen to port 80 when below command is executed.
geddy -e production &
The problem in this CLI command is when the SSH connection to VM was disconnected the process automatically gets closed. To make application working SSH needs to be opened always which is not possible. Is there any alternative method to keep it running as background service.
This happens because processes that are merely backgrounded will be sent a SIGHUP
signal when their controlling terminal (the SSH connection) is closed.
The traditional method of preventing this is using the nohup
utility:
nohup geddy -e production &
Alternatively, you can use terminal multiplexers like screen
or tmux
to create persistent terminal sessions (ones that remain active when you log out, and that can be reattached when you log in again at a later time).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With