Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

There was a problem

You must be a member of this account.

empty pid files should be ignored/deleted instead of raising Thin::PidFileExist

#137

When starting in daeomonized mode, Thin checks the pidfile, read the number in it and, if that Process ID is already running, a Thin::PidFileExist exception is raised, which is correct.

If the pid in the pidfile does not correspond to any running process, the pidfile is considered "stale", and is deleted. This is correct too.

But sometimes it may happen to find an empty pidfile, for example after a power failure when the filesystem was not sync'ed. In this case, Thin believes that the process ID is 0, which is always running (the OS kernel?) :-P

This is certainly not correct! A pidfile with no valuable data in it should be simply ignored and/or deleted.

Here the error messages from Thin:

/usr/local/lib/ruby/gems/1.9.1/gems/thin-1.2.7/lib/thin/daemonizing.rb:167:in `remove_stale_pid_file': thin.pid already exists, seems like it's already running (process ID: 0). Stop
the process or delete thin.pid. (Thin::PidFileExist)
        from /usr/local/lib/ruby/gems/1.9.1/gems/thin-1.2.7/lib/thin/daemonizing.rb:40:in `daemonize'
        from /usr/local/lib/ruby/gems/1.9.1/gems/thin-1.2.7/lib/thin/controllers/controller.rb:55:in `start'
        from /usr/local/lib/ruby/gems/1.9.1/gems/thin-1.2.7/lib/thin/runner.rb:177:in `run_command'
        from /usr/local/lib/ruby/gems/1.9.1/gems/thin-1.2.7/lib/thin/runner.rb:143:in `run!'
        from /usr/local/lib/ruby/gems/1.9.1/gems/thin-1.2.7/bin/thin:6:in `<top (required)>'
        from /usr/local/bin/thin:19:in `load'
        from /usr/local/bin/thin:19:in `<main>'

Thanks in advance!
G.

Reported by Guido De Rosa · August 11th, 2010 @ 11:58 AM

State: new
Milestone: none
Assigned to: macournoyer macournoyer

Activity

  1. Guido De Rosa
    Guido De Rosa
    • Assigned user set to macournoyer

    August 17th, 2010 @ 06:46 AM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.