Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Signals and Restarting Syscalls

Thread Tools

Signals and Restarting Syscalls

Curt Sampson
Posts: n/a
I'm using fcgi.rb ruby-fcgi (0.8.7, according to the tarfile name, 0.8.5
according to the comment in the source) and lighttpd. Unfortunately, lighttpd
can't seem to shut down the ruby FastCGI servers:

25457 1 lighttpd CALL kill(0x2095, SIGTERM)
25457 1 lighttpd RET kill 0
8341 1 ruby18 RET accept RESTART
8341 1 ruby18 PSIG SIGTERM caught handler=0xbbbabdfc mask=())
8341 1 ruby18 CALL setcontext(0xbfbe7df4)
8341 1 ruby18 RET setcontext JUSTRETURN
8341 1 ruby18 CALL accept(0,0xbfbe8190,0xbfbe818c)
25457 1 lighttpd CALL unlink(0x806e800)
25457 1 lighttpd NAMI "/u/cjs/co/dcity/instance.31041/sock/fastcgi-root-0"

It appears that the ruby interpreter, in ruby_signal() in signal.c, goes
and sets the SA_RESTART flag in the structure it passes to sigaction().
So, the accept syscall that it's sitting in won't be returned from until
the socket gets a connection, which is never going to happen because the
socket file is gone.

Anybody have any thoughts on what I can do about this silliness, short of
modifying the Ruby interpreter?

And why does Ruby do this, anyway?

Curt Sampson <(E-Mail Removed)> +81 90 7737 2974
The power of accurate observation is commonly called cynicism
by those who have not got it. --George Bernard Shaw

Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Change to web.config and restarting application. zb ASP .Net 7 01-11-2007 12:39 AM
KeyboardInterrupt from syscalls Fredrik Tolf Python 0 11-22-2006 06:39 PM 2.0, temporary assembly generation mechanism, and application restarting sonic ASP .Net 0 05-23-2006 06:35 PM
syscalls.h or equivalent in cygwin or Linux Jan van Mansum C Programming 4 06-05-2004 10:59 PM
Windows 2000 Pro machine crashing and restarting when using Explorer, for example. Will Computer Support 1 05-19-2004 06:14 PM