On Friday 23 July 2010 18:40, Jason wrote: > It took me some time to figure this out so I'm sending this to the > list in case it helps others. > > If you're getting this message when you launch a shell (sh): > > "can't access tty; job control turned off" > > And you've looked at the FAQ on the subject: > > http://www.busybox.net/FAQ.html#job_control > > But you're still having a problem.
Can you be more specific: what problem? > Try this: > > setsid cttyhack sh > > It will give you a controlling terminal (tty1) with job control turned > on without requiring a login. (1) I don't want to mention a non-standard tool ctty in this FAQ entry. ctty*hack* is names a *hack* for a reason. (2) "setsid cttyhack sh" without exec creates a *child* shell. This FAQ is meant to show how to give a ctty to *PID 1* shell. This is important if the user wants to hand off control of the boot process a-la "exec /sbin/init" later. > Note to web admin: It would be helpful if "setsid cttyhack sh" was > mentioned in the FAQ as a solution, as the solutions presented in the > FAQ do not work from the /init script within initramfs. At least they > wouldn't work for me. The console would hang if I tried to do __ exec > setsid sh -c 'exec sh </dev/tty1 >/dev/tty1 2>&1' __ from my /init script. > > Also, so the console doesn't hang when I type "exit", I do this in my > /init script: > > setsid cttyhack sh > # reboot if user types "exit" > echo s > /proc/sysrq-trigger # Sync There is "sync" comand > echo u > /proc/sysrq-trigger # Unmount (actually remounts > everything read-only) and "umount -a" > echo b > /proc/sysrq-trigger # reBoot > > This requires that you have CONFIG_MAGIC_SYSRQ enabled in your kernel. > If someone has a better solution, please share. Try "reboot -f". > The reboot, halt, and > shutdown commands provided by busybox don't do anything for me. Can you please give more meaningful bug reports? "Does not work" isn't really providing enough information. > I assume they require busybox's init to be running. Without -f, yes, they do. That's the design (more like design flaw) of traditional Unix way to shut down. -- vda _______________________________________________ busybox mailing list [email protected] http://lists.busybox.net/mailman/listinfo/busybox
