|
Re: 1.00-pre1 problem: can't umount oldroot after pivot_root&chroot: msg#00223linux.busybox
Yang Xiaopeng wrote: Old /proc is unmounted when init restart, before executing my scripts,I found the problem, I said that no user process use old root when run my scripts, but I'm wrong, actually there is a '3' fd open the file "/old_root/dev/console". By adding debug message in init/init.c, I found the problem: when init restart(in exec_signal()), before open the new terminal device, there is still a file opened(I don't know which file it is), so the terminal device(stdin) get fd '1', and the first dup(0)(stdout) return '2', the second(stderr) return '3'. I attach a simple patch to solve this problem. diff -urN busybox-1.00-pre1/init/init.c busybox-1.00/init/init.c --- busybox-1.00-pre1/init/init.c 2003-07-15 05:20:53.000000000 +0800 +++ busybox-1.00/init/init.c 2003-07-29 09:55:07.000000000 +0800 @@ -741,6 +741,11 @@ sigaddset(&unblock_signals, SIGTSTP); sigprocmask(SIG_UNBLOCK, &unblock_signals, NULL); + /* Close whatever files are open. */ + close(0); + close(1); + close(2); + /* Open the new terminal device */ if ((device_open(a->terminal, O_RDWR)) < 0) { if (stat(a->terminal, &sb) != 0) { _______________________________________________ busybox mailing list busybox@xxxxxxxxxxxxxxxx http://codepoet.org/mailman/listinfo/busybox |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: patch to login, dmesg and obscure: 00223, Robert Griebl |
|---|---|
| Next by Date: | Re: 1.00-pre1 problem: can't umount oldroot after pivot_root&chroot: 00223, Erik Andersen |
| Previous by Thread: | Re: 1.00-pre1 problem: can't umount oldroot after pivot_root&chrooti: 00223, Yang Xiaopeng |
| Next by Thread: | Re: 1.00-pre1 problem: can't umount oldroot after pivot_root&chroot: 00223, Erik Andersen |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |