[rails] dispatch.fcgi do not exiting ..

Discussion in 'Ruby' started by Marcin Jurczuk, Nov 2, 2005.

  1. Helo Group.
    I'm trying to setup rails with lighttpd on Linux and have strange problem

    When I'm starting lighttpd fcgi processess are spawn OK.
    16386 ? S 0:00 /usr/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf
    16387 ? R 0:00 /usr/bin/ruby /var/www/rmgr/public/dispatch.fcgi
    16388 ? R 0:00 /usr/bin/ruby /var/www/rmgr/public/dispatch.fcgi
    16389 ? R 0:00 /usr/bin/ruby /var/www/rmgr/public/dispatch.fcgi
    16390 ? R 0:00 /usr/bin/ruby /var/www/rmgr/public/dispatch.fcgi

    But after shutting it down:
    root@ubuntu:~# rclighttpd stop
    Stopping lighttpd: lighttpd.
    root@ubuntu:~# ps xa|grep ruby
    16387 ? S 0:02 /usr/bin/ruby /var/www/rmgr/public/dispatch.fcgi
    16388 ? S 0:02 /usr/bin/ruby /var/www/rmgr/public/dispatch.fcgi
    16389 ? S 0:02 /usr/bin/ruby /var/www/rmgr/public/dispatch.fcgi
    16390 ? S 0:02 /usr/bin/ruby /var/www/rmgr/public/dispatch.fcgi
    root@ubuntu:~#

    dispatch.fcgi processes are still in process table

    killing with -TERM signal dosn't help:
    root@ubuntu:~# killall dispatch.fcgi && ps xa|grep dispatch|wc -l
    5
    root@ubuntu:~# killall -9 dispatch.fcgi
    root@ubuntu:~# ps xa|grep dispatch
    root@ubuntu:~#

    This helps :)

    I've tried it on Ubunut,SuSE - result is the same..

    One thing ...logs showing something like this:
    [02/Nov/2005:16:31:48 :: 16515] asked to terminate ASAP
    [02/Nov/2005:16:31:48 :: 16514] asked to terminate ASAP
    [02/Nov/2005:16:31:48 :: 16513] asked to terminate ASAP

    Of course those proces never terminate without my intervention :(

    Any ideas ? Any help ?

    --
    Spock ... Earth ..
    Marcin Jurczuk, Nov 2, 2005
    #1
    1. Advertising

  2. Marcin Jurczuk

    Jamis Buck Guest

    This is now fixed in edge rails. TERM will always immediately exit.
    However, it should be noted that shutting down this way can result in
    aborted requests, causing HTTP 500 errors to be served up to the
    client. Thus, the USR1 signals (which previously behaved identically
    to TERM) will still behave "lazily", waiting until after the next
    request to shutdown.

    This should allow the listeners to behave better across a restart of
    apache or lighttpd, and still allow USR1 to be used for a clean
    shutdown of just the listeners.

    Note that the preferred way of restarting your application is via the
    USR2 signal, which causes the listeners to gracefully restart without
    needing to restart your web server software. However, this approach
    is known to have some issues on some platforms if your listeners are
    managed by the web server itself, so it is really only recommended if
    you are managing your listeners directly (via, for instance, spawn-
    fcgi).

    - Jamis

    On Nov 2, 2005, at 8:37 AM, Marcin Jurczuk wrote:

    > Helo Group.
    > I'm trying to setup rails with lighttpd on Linux and have strange
    > problem
    >
    > When I'm starting lighttpd fcgi processess are spawn OK.
    > 16386 ? S 0:00 /usr/sbin/lighttpd -f /etc/lighttpd/
    > lighttpd.conf
    > 16387 ? R 0:00 /usr/bin/ruby /var/www/rmgr/public/
    > dispatch.fcgi
    > 16388 ? R 0:00 /usr/bin/ruby /var/www/rmgr/public/
    > dispatch.fcgi
    > 16389 ? R 0:00 /usr/bin/ruby /var/www/rmgr/public/
    > dispatch.fcgi
    > 16390 ? R 0:00 /usr/bin/ruby /var/www/rmgr/public/
    > dispatch.fcgi
    >
    > But after shutting it down:
    > root@ubuntu:~# rclighttpd stop
    > Stopping lighttpd: lighttpd.
    > root@ubuntu:~# ps xa|grep ruby
    > 16387 ? S 0:02 /usr/bin/ruby /var/www/rmgr/public/
    > dispatch.fcgi
    > 16388 ? S 0:02 /usr/bin/ruby /var/www/rmgr/public/
    > dispatch.fcgi
    > 16389 ? S 0:02 /usr/bin/ruby /var/www/rmgr/public/
    > dispatch.fcgi
    > 16390 ? S 0:02 /usr/bin/ruby /var/www/rmgr/public/
    > dispatch.fcgi
    > root@ubuntu:~#
    >
    > dispatch.fcgi processes are still in process table
    >
    > killing with -TERM signal dosn't help:
    > root@ubuntu:~# killall dispatch.fcgi && ps xa|grep dispatch|wc -l
    > 5
    > root@ubuntu:~# killall -9 dispatch.fcgi
    > root@ubuntu:~# ps xa|grep dispatch
    > root@ubuntu:~#
    >
    > This helps :)
    >
    > I've tried it on Ubunut,SuSE - result is the same..
    >
    > One thing ...logs showing something like this:
    > [02/Nov/2005:16:31:48 :: 16515] asked to terminate ASAP
    > [02/Nov/2005:16:31:48 :: 16514] asked to terminate ASAP
    > [02/Nov/2005:16:31:48 :: 16513] asked to terminate ASAP
    >
    > Of course those proces never terminate without my intervention :(
    >
    > Any ideas ? Any help ?
    >
    > --
    > Spock ... Earth ..
    >
    Jamis Buck, Nov 2, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. David Heinemeier Hansson
    Replies:
    1
    Views:
    95
    Bill Guindon
    Mar 7, 2005
  2. benny
    Replies:
    6
    Views:
    132
    Dick Davies
    Apr 25, 2005
  3. Replies:
    7
    Views:
    145
    Bob Hutchison
    Jan 11, 2006
  4. Replies:
    1
    Views:
    173
    Jan Svitok
    Aug 2, 2006
  5. Javier Abaroa

    fcgi or ruby-fcgi on Windows-Xp

    Javier Abaroa, Apr 16, 2010, in forum: Ruby
    Replies:
    2
    Views:
    350
    Javier Abaroa
    Apr 19, 2010
Loading...

Share This Page