I am trying to run a little init script instead of sysvinit, which drops me in a shell. My code for the init script is:
#!/bin/sh
PATH=/sbin:/bin:/usr/sbin:/usr/sbin
mount -t proc proc /proc
mount -t sysfs sysfs /sys
mount -t devtmpfs none /dev
exec sh
But when it drops me in the shell this error appears:
sh: cannot set terminal process group (-1): Inappropriate ioctl for device
sh: no job control in this shell
The command tty
returns /dev/console
. I am dropped in as root and the set of commands that I tried are working correctly.
That error message likely means shell is probably calling tcsetpgrp()
and getting back errno=ENOTTY
. That can happen if the shell process does not have a controlling terminal. The kernel doesn't set that up before running init
on /dev/console
.
You have already discovered the solution: use a real terminal device like /dev/tty0
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With