I am trying to run agetty in a runit based linux system, but I have the following problem
sh: cannot set terminal process group (136) Inappropriate ioctl for device
sh: no job control in this shell
I have no clue about this error, do you have some ideas
The script for running agetty is
#!/bin/sh
exec /sbin/agetty 38400 tty1 linux --noclear
Any help will be good.
Best Answer
Use
setsid
as follows.The
setsid
wrapper will start agetty as a session leader (see this answer), allowing it to bind totty1
.You can see the different behavior from the following example
ps
.The
agetty-3
service usedsetsid
, whereasagetty-4
did not. Therefore, the shell on tty3 is session leader and bound to its tty. The shell on tty4 is in the same session of its supervisor and not bound (?
in tty column).