#144 new
Clint Pachl

Errno::EPERM wtih QUIT Signal

Reported by Clint Pachl | February 23rd, 2011 @ 07:24 PM

STARTING/STOPPING:

$ sudo -u #{USER} thin -C #{THIN_PRODUCTION_CONF} start
$ sudo -u #{USER} thin -C #{THIN_PRODUCTION_CONF} stop

THIN_PRODUCTION_CONF:

---
rackup: config/config.ru
address: localhost
port: 3020
servers: 4
max_conns: 1024
max_persistent_conns: 512
timeout: 30
environment: production
pid: tmp/thin-production.pid
log: log/thin-production.log
daemonize: true

When sending the thin "stop" command, I get the following error on STDOUT:

Stopping server on localhost:3020 ...
Sending QUIT signal to process 15182 ...
/usr/local/lib/ruby/gems/1.8/gems/thin-1.2.7/lib/thin/daemonizing.rb:7:in `getpgid': Operation not permitted (Errno::EPERM)
    from /usr/local/lib/ruby/gems/1.8/gems/thin-1.2.7/lib/thin/daemonizing.rb:7:in `running?'
    from /usr/local/lib/ruby/gems/1.8/gems/thin-1.2.7/lib/thin/daemonizing.rb:118:in `send_signal'
    from /usr/local/lib/ruby/1.8/timeout.rb:67:in `timeout'
    from /usr/local/lib/ruby/gems/1.8/gems/thin-1.2.7/lib/thin/daemonizing.rb:117:in `send_signal'
    from /usr/local/lib/ruby/gems/1.8/gems/thin-1.2.7/lib/thin/daemonizing.rb:103:in `kill'
    from /usr/local/lib/ruby/gems/1.8/gems/thin-1.2.7/lib/thin/controllers/controller.rb:87:in `stop'
    from /usr/local/lib/ruby/gems/1.8/gems/thin-1.2.7/lib/thin/controllers/controller.rb:128:in `tail_log'
    from /usr/local/lib/ruby/gems/1.8/gems/thin-1.2.7/lib/thin/controllers/controller.rb:86:in `stop'
    from /usr/local/lib/ruby/gems/1.8/gems/thin-1.2.7/lib/thin/runner.rb:177:in `send'
    from /usr/local/lib/ruby/gems/1.8/gems/thin-1.2.7/lib/thin/runner.rb:177:in `run_command'
    from /usr/local/lib/ruby/gems/1.8/gems/thin-1.2.7/lib/thin/runner.rb:143:in `run!'
    from /usr/local/lib/ruby/gems/1.8/gems/thin-1.2.7/bin/thin:6
    from /usr/local/bin/thin:19:in `load'
    from /usr/local/bin/thin:19

Here's a snipped from daemonizing.rb:

 6: def running?(pid)
 7:    Process.getpgid(pid) != -1
 8:  rescue Errno::ESRCH
 9:    false
10:  end

As you can see, the ESRCH error is rescued here, which is the other error that getpgid(2) can return. I'm on OpenBSD 4.9.

Can anyone explain this?

When the thin processes are daemonized, are they detached from the session and that's why it's complaining with an EPERM error?

The daemonized processes all do quit, but not without a delay, which may be the reason for entering the timeout.rb code? So I'm not sure I need to worry. I've been running things like this for over 2 years now, but I'd just like to quiet it down as it doesn't seem normal.

Thanks,

Clint

No comments found

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

People watching this ticket

Pages