Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Geddy CLI closes on SSH drop

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.

like image 244
arvindwill Avatar asked Mar 11 '17 05:03

arvindwill


1 Answers

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).

like image 97
robertklep Avatar answered Oct 04 '22 16:10

robertklep