On Tue, Sep 09, 2003 at 02:21:21AM +0900, mgarriss wrote:
> Is this expected or am I doing something wrong?:
> 
> ---- mgarriss@frodo [0] 11:19:06 ~ ----
> uname -a
> Linux frodo 2.4.20-8 #1 Thu Mar 13 17:18:24 EST 2003 i686 athlon i386 
> GNU/Linux
> ---- mgarriss@frodo [0] 11:19:13 ~ ----
> ruby -v
> ruby 1.8.0 (2003-08-04) [i686-linux]
> ---- mgarriss@frodo [0] 11:19:19 ~ ----
> ruby -e 'Process.setsid'
> -e:1:in `setsid': Operation not permitted (Errno::EPERM)
>        from -e:1

According to the setsid(2) man page:

ERRORS
     The setsid() function will fail if:

     EPERM The calling process is already a process group leader,
           or  the  process group  ID of a process other than the
           calling process matches the process  ID of the calling
           process.

So it's failing because the Ruby process is already a pgroup leader.