What does it mean that sh: cannot set the terminal process group (-1) that does not match ioctl for a device error?

I am trying to run a little init script instead of sysvinit, which throws me into a shell. My code for init script:

#!/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 changes to the shell, this error appears:

 sh: cannot set terminal process group (-1): Inappropriate ioctl for device sh: no job control in this shell 

The tty command returns /dev/console . They throw me as root, and the set of commands that I tried works correctly.

+7
shell
source share
1 answer

This error message probably means that the shell probably calls tcsetpgrp() and errno=ENOTTY . This can happen if there is no control terminal in the shell process. The kernel does not install this until init starts on /dev/console .

You have already found a solution: use a real terminal device, for example /dev/tty0 .

+1
source share

All Articles