| Anonymous | Login | Signup for a new account | 11-10-2008 11:22 PST |
| Main | My View | View Issues | Change Log | Docs |
| Viewing Issue Simple Details [ Jump to Notes ] | [ View Advanced ] [ Issue History ] [ Print ] | ||||||||
| ID | Category | Severity | Reproducibility | Date Submitted | Last Update | ||||
| 0001597 | [BusyBox] Other | major | always | 11-19-07 11:40 | 02-13-08 07:39 | ||||
| Reporter | vomlehn | View Status | public | ||||||
| Assigned To | BusyBox | ||||||||
| Priority | normal | Resolution | fixed | ||||||
| Status | closed | Product Version | |||||||
| Summary | 0001597: If stdout is not open, redirection to a file causes that file to always be used as stdout | ||||||||
| Description |
I am booting an INITRAMFS filesystem in which /init is a script that starts with "#!/bin/sh" and, so, invokes busybox. My console is a USB serial device and things work normally if I have a serial device attached. If I boot my system with no USB serial device attached, the open of /dev/console fails and the busybox has no open file descriptors when it starts. In my /init script, I use: echo /sbin/hotplug >/proc/sys/kernel/hotplug The correct data is put into that pseudo-file. The problem is that subsequent output is *also* put into that pseudo-file. This is a big problem since my hotplug script is no longer getting run. My guess is that, when cleaning up after a command, busybox closes all file descriptors except for 0, 1, and 2 (standard in, out, and error). This would be incorrect behavior. I think it should close *every* file descriptor opened by the command. This would restore it to having no file descriptors open, which would prevent data from going to the wrong file. There appear to be two ways to implement this: 1. Keep track of every open and close, and close everything opened during invocation of a command. 2. Determine whether file descriptors 0, 1, and 2 are open at initialization, at command termination, close each one that wasn't open. |
||||||||
| Additional Information | |||||||||
| Attached Files |
|
||||||||
|
|
|||||||||
| Copyright © 2000 - 2006 Mantis Group |