Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6161831
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T21:32:43+00:00 2026-05-23T21:32:43+00:00

bundle exec thin start -p 3111 gives the following output: Using rack adapter Thin

  • 0

bundle exec thin start -p 3111 gives the following output:

Using rack adapter
Thin web server (v1.2.11 codename Bat-Shit Crazy)
Maximum connections set to 1024
Listening on 0.0.0.0:3111, CTRL+C to stop
^C

Ctrl-C doesn’t do anything (SIGINT). Neither does kill (SIGTERM).

I’ve found a few references to this behavior, but no solutions. The problem seems to be either in eventmachine (bundled with latest thin), in ruby 1.9.2-r290, or in the linux kernel (Ubuntu 10.4 LTS, 2.6.38.3-linode32).

It happens with my project, but not with a brand new rails project.

References:

  • http://groups.google.com/group/thin-ruby/browse_thread/thread/4b7c28e8964b5001?fwc=2
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T21:32:45+00:00Added an answer on May 23, 2026 at 9:32 pm

    My guess is that either something’s tying up the EventMachine reactor loop preventing it from exiting, or something’s trapping SIGINT.

    As a simple example of the former, put this into config.ru and run with thin -p 4567 start:

    require 'thin'
    require 'sinatra'
    require 'eventmachine'
    
    
    get '/' do
      "hello world"
    end
    
    run Sinatra::Application
    
    EventMachine.schedule do
      trap("INT") do
        puts "Caught SIGINT"
        EventMachine.stop # this is useless
        # exit # this stops the EventMachine
      end
    
      i = 0
      while i < 10
        puts "EM Running"
        i += 1
        sleep 1
      end
    end
    

    Without trapping the SIGINT, you get the same behavior as when trapping it and calling EM.stop. EM.stop (at least in the pure ruby version, which you can run with EVENTMACHINE_LIBRARY="pure_ruby" thin start) sets a flag that a stop has been requested, which is picked up inside the reactor loop. If the reactor loop is stuck on a step (as in the above case), then it won’t exit.

    So a couple options:

    1. use the workaround above of trapping SIGINT and forcing an exit. This could leave connections in an unclean state, but they don’t call it quick & dirty for nothing 😉

    2. you could put the blocking code inside a Thread or a Fiber, which will allow the reactor to keep running.

    3. look for long-running tasks or loops inside your code, and convert these to be EventMachine aware. em-http-request is a great library for external http requests, and em-synchrony has several other protocols (for database connections, tcp connection pools, etc.). In the above example, this is straightforward: EventMachine.add_periodic_timer(1) { puts "EM Running" }

    In your actual code, this might be harder to track down, but look for any places where you spawn threads and join them, or large loops. A profiling tool can help show what code is running when you try to exit, and lastly you can try disabling various parts of the system and libraries to figure out where the culprit is.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Below are 3 random runs using time rspec spec vs time bundle exec spec
I've ran bundle exec rake db:migrate and have 2 databases. I'm also using SQLite
When running bundle exec rake routes in my app directory I get the following
I want use always thin when I start my rails server in development mode.
I'm running ruby-debug with bundle exec rdebug script/server on Rails 2.3. When I press
iam using setting.bundle and i try to show a hidden picture with Switch toggle
I have a settings bundle in my iPhone app, with the following PList: Type:
I want to create a Java application bundle for Mac without using Mac. According
what is the naming convention for message bundle property files when using variants? for
Trying to get Thin working with Bundle on Windows, I know, major PITA but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.