[#23231] What do you think about changing the return value of Kernel#require and Kernel#load to the source encoding of the required file? — =?ISO-8859-15?Q?Wolfgang_N=E1dasi-Donner?= <ed.odanow@...>

Dear Ruby developers and users!

8 messages 2009/04/17

[#23318] [Feature #1408] 0.1.to_r not equal to (1/10) — Heesob Park <redmine@...>

Feature #1408: 0.1.to_r not equal to (1/10)

19 messages 2009/04/26

[ruby-core:23309] Re: [Bug #1403] Process.daemon should do a double fork to avoid problems with controlling terminals

From: Tanaka Akira <akr@...>
Date: 2009-04-25 03:10:59 UTC
List: ruby-core #23309
In article <49f26316.8602be0a.1190.2d9f@mx.google.com>,
  Nobuyoshi Nakada <nobu@ruby-lang.org> writes:

>> The second fork ensures that the process (the grandchild of the  
>> original process) is no longer a session leader and therefore can't  
>> acquire a controlling terminal by opening a tty device.
>
> Could you show concrete example?

% ruby -v -rpty -e '
m, s = PTY.open
Process.daemon(true,true)
system("ps cj#{$$}")
open(s.path)
system("ps cj#{$$}")
'; sleep 1
ruby 1.9.2dev (2009-03-13 trunk 22936) [i686-linux]
 PPID   PID  PGID   SID TTY      TPGID STAT   UID   TIME COMMAND
    1  6153  6153  6153 ?           -1 Rsl   1000   0:00 ruby
 PPID   PID  PGID   SID TTY      TPGID STAT   UID   TIME COMMAND
    1  6153  6153  6153 pts/11    6153 Rs+   1000   0:00 ruby

This request means that 2nd TTY field should be "?" as 1st.

fork after Process.daemon does that.

% ruby -v -rpty -e '
m, s = PTY.open
Process.daemon(true,true)
exit if fork != nil
system("ps cj#{$$}")
open(s.path)
system("ps cj#{$$}")
'; sleep 1
ruby 1.9.2dev (2009-03-13 trunk 22936) [i686-linux]
 PPID   PID  PGID   SID TTY      TPGID STAT   UID   TIME COMMAND
    1  6241  6238  6238 ?           -1 Sl    1000   0:00 ruby
 PPID   PID  PGID   SID TTY      TPGID STAT   UID   TIME COMMAND
    1  6241  6238  6238 ?           -1 Sl    1000   0:00 ruby

I'm not sure this is a bug of daemon() in glibc or not.
[ruby-talk:111518]
-- 
Tanaka Akira

In This Thread