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.