getting a console prog to run on tty2 at bootup
am 10.12.2004 14:11:15 von James Miller
Hello all. I'm running a new Debian variant called "Ubuntu"--sort of an
unstable/testing composite. I run a number of console apps and like to
keep a virtual console open for them (as opposed to using xterms). I've
found a nice sort of console windowing program called "twin" that allows
me to run all my console apps in a single virtual terminal. Right now, I
start all this manually: on bootup, I hit ctrl-alt-F2 and issue the
command to start twin. What I'd like to do is automate it a bit more so
that twin automatically runs on tty2 when I boot the system. I understand
that I probably need to edit the file /etc/inittab to make this happen.
Is this correct? Are there any other startup files that would need
editing to do what I want here? Furthermore, exactly how would I edit
/etc/inittab to accomplish this? I think the relevant portion of the file
to edit is this one:
# Note that on most Debian systems tty7 is used by the X Window System,
# so if you want to add more getty's go ahead but skip tty7 if you run X.
#
1:2345:respawn:/sbin/getty 38400 tty1
2:23:respawn:/sbin/getty 38400 tty2
3:23:respawn:/sbin/getty 38400 tty3
4:23:respawn:/sbin/getty 38400 tty4
5:23:respawn:/sbin/getty 38400 tty5
6:23:respawn:/sbin/getty 38400 tty6
I think the 23 refers to the port telnet runs on, right? Seems I need to
edit the line 2:23:respawn:/sbin/getty 38400 tty2, but the question is
how? Do I replace /sbin/getty with the path to twin and add any command
line switches after (-hw=tty is what I use when I run it manually from a
console)? Does the 38400 need to be in there, and for that matter, the
23?
Any advice on editing relevant startup files properly in order to get twin
running on tty2 at system startup would be appreciated.
Thanks, James
PS I log into the virtual terminal as my system's user before running twin
when I do this manually.
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
Re: getting a console prog to run on tty2 at bootup
am 11.12.2004 07:07:54 von Eric Bambach
On Friday 10 December 2004 07:11 am, James Miller wrote:
> Hello all. I'm running a new Debian variant called "Ubuntu"--sort of an
> unstable/testing composite. I run a number of console apps and like to
> keep a virtual console open for them (as opposed to using xterms). I've
> found a nice sort of console windowing program called "twin" that allows
> me to run all my console apps in a single virtual terminal. Right now, I
> start all this manually: on bootup, I hit ctrl-alt-F2 and issue the
> command to start twin. What I'd like to do is automate it a bit more so
> that twin automatically runs on tty2 when I boot the system. I understand
> that I probably need to edit the file /etc/inittab to make this happen.
> Is this correct? Are there any other startup files that would need
> editing to do what I want here?
Nah, inittab should do it :)
> Furthermore, exactly how would I edit
> /etc/inittab to accomplish this? I think the relevant portion of the file
> to edit is this one:
See below. Yes thats exactly the spot.
> # Note that on most Debian systems tty7 is used by the X Window System,
> # so if you want to add more getty's go ahead but skip tty7 if you run X.
> #
> 1:2345:respawn:/sbin/getty 38400 tty1
> 2:23:respawn:/sbin/getty 38400 tty2
> 3:23:respawn:/sbin/getty 38400 tty3
> 4:23:respawn:/sbin/getty 38400 tty4
> 5:23:respawn:/sbin/getty 38400 tty5
> 6:23:respawn:/sbin/getty 38400 tty6
>
> I think the 23 refers to the port telnet runs on, right? Seems I need to
> edit the line 2:23:respawn:/sbin/getty 38400 tty2, but the question is
> how? Do I replace /sbin/getty with the path to twin and add any command
> line switches after (-hw=tty is what I use when I run it manually from a
> console)? Does the 38400 need to be in there, and for that matter, the
> 23?
Yes telnet DOES run on 23, but that has nothing to do with the file ;)
the first number is the virtual console # and the second number is the
runlevels. Notice that VC 1 ALWAYS starts up: runlevels 2345. Try something
like this and make sure to comment out the original line:
2:23:respawn:/bin/twin -hw=tty -etc -etc -etc -more -args
And run init -q (from memory, if -q doesnt work try man init) to get init to
re-read the conf file. Dont worry if you bork the line, init will disable
respawning if the program respawns too fast. If that happens just correct the
line and run init -q again. Since you said this is a test box I don't think
you'll have too much trouble if you happen to screw something up that
requires a reboot ;)
> Any advice on editing relevant startup files properly in order to get twin
> running on tty2 at system startup would be appreciated.
I am not very experienced in what you are trying to do EXACTLY but its close
enough you should be able to figure it out form there.The 38400 and firends
are command line arguments to getty. Just drop them. The fields go
VC# : RUNLEVELS : OPTIONS : COMMAND
> Thanks, James
>
> PS I log into the virtual terminal as my system's user before running twin
> when I do this manually.
--
-EB
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs
Re: getting a console prog to run on tty2 at bootup
am 13.12.2004 22:36:59 von Stephen Samuel
Eric Bambach wrote:
>># Note that on most Debian systems tty7 is used by the X Window System,
>># so if you want to add more getty's go ahead but skip tty7 if you run X.
>>#
>>1:2345:respawn:/sbin/getty 38400 tty1
>>2:23:respawn:/sbin/getty 38400 tty2
>>3:23:respawn:/sbin/getty 38400 tty3
>>4:23:respawn:/sbin/getty 38400 tty4
>>5:23:respawn:/sbin/getty 38400 tty5
>>6:23:respawn:/sbin/getty 38400 tty6
>>
>>I think the 23 refers to the port telnet runs on, right? Seems I need to
>>edit the line 2:23:respawn:/sbin/getty 38400 tty2, but the question is
>>how? Do I replace /sbin/getty with the path to twin and add any command
>>line switches after (-hw=tty is what I use when I run it manually from a
>>console)? Does the 38400 need to be in there, and for that matter, the
>>23?
>
>
> Yes telnet DOES run on 23, but that has nothing to do with the file ;)
> the first number is the virtual console # and the second number is the
> runlevels. Notice that VC 1 ALWAYS starts up: runlevels 2345. Try something
> like this and make sure to comment out the original line:
Close: The first field can be just about anything short. It's
an identifier used for other init(8) tricks. In this case,
numbers were chosen to represent the TTY that the program runs on.
The second field (as stated) indicates which runlevels the program
runs on (In this case, the getty on tty1 runs at runlevels 2,3,4 and 5
while the other ones (2-6) only run at runleels 2 and 3.
the respawn in the 3rd field says to rerun the program when it dies.
The last field is the command line that is run at the indicated
run levels.
What actually makes the programs run on their respective TTYs is the
parameter to the getty program. There are a number of versions
of the getty command for Linux. `man -k getty ` for more info on
which versions are available on your system).
--
Stephen Samuel +1(604)876-0426 samuel@bcgreen.com
http://www.bcgreen.com/~samuel/
Powerful committed communication. Transformation touching
the jewel within each person and bringing it to light.
-
To unsubscribe from this list: send the line "unsubscribe linux-newbie" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.linux-learn.org/faqs