What is this command really doing (step by step)?openvt -c 40 /bin/agetty tty40 linuxI tried this command instead :openvt -c 41 /bin/agetty tty40 linuxand agetty was started on tty40 (not tty41). Why is that? It seems the -c 41 option is not necessary. Removing it yields the same result.
What is this openvt command doing?
tty;getty;chvt
openvt -c 40 /bin/agetty tty40 linuxruns openvt, directing it to use VT 40; so it opens that VT, and runs agetty on it. But specifying tty40 as an argument to agetty tells the latter to use VT 40 (regardless of where it was started), so it opens VT 40 itself and runs there.Thus,openvt -c 41 /bin/agetty tty40 linuxopens VT 41, but then agetty opens VT 40 itself.You should just use one program to open the VT. You can either run agetty directly on whichever VT you want, or tell it to run wherever its been started:agetty tty40 linuxopenvt -c 40 agetty - linuxIf you remove the -c option, openvt will pick the first available VT.