I am trying to make an executable that launches a Sinatra application through Thin as a daemon. I use this code to call Thin using the Sinatra app:
#!/usr/bin/env ruby require 'thin' require 'app.rb' server = ::Thin::Server.new('127.0.0.1', 9999, App) server.log_file = 'tmp/thin.log' server.pid_file = 'tmp/thin.pid' server.daemonize
Here is the log output that I get when I execute the script:
>> Writing PID to tmp/thin.pid >> Exiting!
The server starts working fine when I do
server.start
Any suggestions as I track why it comes out immediately?
source share