diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2010-05-15 20:43:07 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-05-15 20:43:07 +0200 |
commit | b367bb2a620d3c349b0a61b949a6ebca32bf5395 (patch) | |
tree | e6871fac55abaae0e388e5351adc0df3081db55f | |
parent | c84c85ae345f6b3a4ba74ae1ab22acddd41fa456 (diff) | |
download | busybox-w32-b367bb2a620d3c349b0a61b949a6ebca32bf5395.tar.gz busybox-w32-b367bb2a620d3c349b0a61b949a6ebca32bf5395.tar.bz2 busybox-w32-b367bb2a620d3c349b0a61b949a6ebca32bf5395.zip |
cttyhack: document the need to setsid
function old new delta
packed_usage 26988 27057 +69
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | include/usage.h | 12 | ||||
-rw-r--r-- | shell/Config.in | 15 |
2 files changed, 23 insertions, 4 deletions
diff --git a/include/usage.h b/include/usage.h index 9d9ad008b..be52f187f 100644 --- a/include/usage.h +++ b/include/usage.h | |||
@@ -649,8 +649,16 @@ | |||
649 | "\n -S SALT" \ | 649 | "\n -S SALT" \ |
650 | ) \ | 650 | ) \ |
651 | 651 | ||
652 | #define cttyhack_trivial_usage NOUSAGE_STR | 652 | #define cttyhack_trivial_usage \ |
653 | #define cttyhack_full_usage "" | 653 | "PROG ARGS" |
654 | #define cttyhack_full_usage "\n\n" \ | ||
655 | "Give PROG a controlling tty if possible." \ | ||
656 | "\nExample for /etc/inittab (for busybox init):" \ | ||
657 | "\n ::respawn:/bin/cttyhack /bin/sh" \ | ||
658 | "\nGiving controlling tty to shell running with PID 1:" \ | ||
659 | "\n $ exec cttyhack sh" \ | ||
660 | "\nStarting an interative shell from boot shell script:" \ | ||
661 | "\n setsid cttyhack sh" \ | ||
654 | 662 | ||
655 | #define cut_trivial_usage \ | 663 | #define cut_trivial_usage \ |
656 | "[OPTIONS] [FILE]..." | 664 | "[OPTIONS] [FILE]..." |
diff --git a/shell/Config.in b/shell/Config.in index 3b1650615..36a931715 100644 --- a/shell/Config.in +++ b/shell/Config.in | |||
@@ -354,9 +354,20 @@ config CTTYHACK | |||
354 | It analyzes stdin with various ioctls, trying to determine whether | 354 | It analyzes stdin with various ioctls, trying to determine whether |
355 | it is a /dev/ttyN or /dev/ttySN (virtual terminal or serial line). | 355 | it is a /dev/ttyN or /dev/ttySN (virtual terminal or serial line). |
356 | If it detects one, it closes stdin/out/err and reopens that device. | 356 | If it detects one, it closes stdin/out/err and reopens that device. |
357 | Then it executes given program. Usage example for /etc/inittab | 357 | Then it executes given program. Opening the device will make |
358 | (for busybox init): | 358 | that device a controlling tty. This may require cttyhack |
359 | to be a session leader. | ||
360 | |||
361 | Example for /etc/inittab (for busybox init): | ||
359 | 362 | ||
360 | ::respawn:/bin/cttyhack /bin/sh | 363 | ::respawn:/bin/cttyhack /bin/sh |
361 | 364 | ||
365 | Giving controlling tty to shell running with PID 1: | ||
366 | |||
367 | $ exec cttyhack sh | ||
368 | |||
369 | Starting an interative shell from boot shell script: | ||
370 | |||
371 | setsid cttyhack sh | ||
372 | |||
362 | endmenu | 373 | endmenu |