This article introduces how to handle situations when Sinatra started via SSH does not terminate or does not work properly.
When you start it like this:
ruby ~/lib/pg/sinatra/app.rb -o 150.95.00.00 -p 80
If you disconnect the SSH connection before terminating Sinatra, Sinatra seems to continue running.
Also, POST doesn’t seem to work properly. This doesn’t mean it can be used as a daemon.
So it’s best to terminate it once.
To terminate it:
ps aux | grep sinatra
kill -9 <pid>