From: Keith R. J. W. <kr...@op...> - 2003-04-21 03:59:59
|
* Thomas Leonard <ta...@ec...> [19/04/2003 0714EDT]: > On Thu, Apr 17, 2003 at 01:56:56PM -0400, Keith R. John Warno wrote: > > * Keith R. John Warno <kr...@op...> [17/04/2003 0927EDT]: > > > * Thomas Leonard <ta...@ec...> [17/04/2003 0857EDT]: > > > > Perhaps something involving TIOCNOTTY (see tty(4)) would help? Anyone want > > > > to have a play around? > > > > That ioctl() doesn't cut it. Not for everything, all the time. > > Daemons, which for argument's sake we can think of ROX-Filer as, > > typically close FDs 0,1,2 and call setsid() to drop the controlling > > terminal. It is not necessarily important to drop the controlling > > terminal (this has side affects anyway), but it is important to drop > > stdin *and* stdout. > > > > See attached patch w/ comments. Maybe a kludge, but it seems to work. > > As the patch says, it's probably better to set things up in the child > process (see rox_spawn()). Aha. I was wondering what function started the children. I will poke around with that. > BTW, opening /dev/null is certainly better than just closing (we've had > trouble with this before). Think of a python program that has a rarely > used code path with a debugging 'print' statement left in. You really > don't want it to die suddenly just because it can't do the print... Hmm yes. In a perfect world, debugging statements always go to stderr, which we've left open (ROX-Session needs it anyway). In any case I do not have any qualms about duping std{in,out} and have them point to /dev/null, although then the python print output won't show up anywhere (still) and won't affect the said code path in any way whatsoever. ;-) Bottom line being std{in,out} must not be connected to a terminal or we will continue to have trouble. I will forward a patch that does, hopefully, the Right Stuff(tm) in rox_spawn(), once I have fullfilled my sleep quota for this evening... krjw. -- Keith R. John Warno [k r j w at optonline dot net] "We flaunt our superpower status with arrogance. After war has ended the United States will have to rebuild much more than the country of Iraq. We will have to rebuild America's image around the globe." -- Senator Robert Byrd (WVA) |