We have written a small client-server program in c/socket. To launch the
server, we call the program which internally fork. The original process
returns immediately but the forked process stays alive and listen to
incoming socket connection.
It’s all fine when running this from bash (we’re on ubuntu) but when
using ruby (with either system, backtick or #x) it’s blocking until both
the original process and the forked process terminate.
Is it what we should expect when calling system? If yes, how could we
work around that?
It’s all fine when running this from bash (we’re on ubuntu) but when
using ruby (with either system, backtick or #x) it’s blocking until both
the original process and the forked process terminate.
Is it what we should expect when calling system? If yes, how could we
work around that?
We have written a small client-server program in c/socket. To launch the
server, we call the program which internally fork. The original process
returns immediately but the forked process stays alive and listen to
incoming socket connection.
It’s all fine when running this from bash (we’re on ubuntu) but when
using ruby (with either system, backtick or #x) it’s blocking until both
the original process and the forked process terminate.
Is it what we should expect when calling system? If yes, how could we
work around that?
Hmmm, might be that you have an issue because your child’s child is
attached to your ruby process once the starter process stops. There is
a whole range of other possible issues causing this which is hard to
sort out given the little information we have. Did you take proper
measures to demonize your child process after fork?
Hmmm, might be that you have an issue because your child’s child is
attached to your ruby process once the starter process stops. There is
a whole range of other possible issues causing this which is hard to
sort out given the little information we have. Did you take proper
measures to demonize your child process after fork?