howtos:serial_console
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
— | howtos:serial_console [02/12/2018 21:34] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Serial Console ====== | ||
+ | This guide is for Ubuntu Hardy Heron or other systems using upstart instead of sysvinit. If you're unsure about what type of system you're using just look for / | ||
+ | |||
+ | ===== getty ===== | ||
+ | Usually getty is installed default (getty is the daemon we're going to use for connecting through the serial console) but just to be sure run: | ||
+ | < | ||
+ | domingo@domingo-desktop: | ||
+ | Usage: getty [-8hiLmUw] [-l login_program] [-t timeout] [-I initstring] [-H login_host] baud_rate, | ||
+ | or [-hiLmw] [-l login_program] [-t timeout] [-I initstring] [-H login_host] line baud_rate, | ||
+ | </ | ||
+ | |||
+ | ===== Spawning getty ===== | ||
+ | To get getty running on the system we need the file / | ||
+ | |||
+ | < | ||
+ | # ttyS0 - getty | ||
+ | # | ||
+ | # This service maintains a getty on ttyS0 from the point the system is | ||
+ | # started until it is shut down again. | ||
+ | |||
+ | start on runlevel 2 | ||
+ | start on runlevel 3 | ||
+ | start on runlevel 4 | ||
+ | start on runlevel 5 | ||
+ | |||
+ | stop on runlevel 0 | ||
+ | stop on runlevel 1 | ||
+ | stop on runlevel 6 | ||
+ | |||
+ | respawn | ||
+ | exec /sbin/getty -L 9600 ttyS0 vt102 | ||
+ | </ | ||
+ | |||
+ | This file setup a console server on the serial interface ttyS0 with the baud speed 9600 and terminal type vt102. You can select an other I just seem to able to remember this one better (I usually only use it when something is terribly wrong and thing need to be fixed fast) and the speed is fine for me. | ||
+ | |||
+ | To invoke the settings without reboot run: | ||
+ | |||
+ | < | ||
+ | sudo initctl start ttyS0 | ||
+ | </ | ||
+ | |||
+ | If no errors occur just run a ps to check if the daemon has started correctly (or just attach a cable): | ||
+ | |||
+ | < | ||
+ | root@server: | ||
+ | root 8567 0.0 0.0 | ||
+ | root 9035 0.0 0.0 | ||
+ | </ | ||
+ | |||
+ | |||
+ | ===== Quick Setting Up Console ===== | ||
+ | If you just need to put up a quick serial console server (ex. to test the communication ports) you can run the following command: | ||
+ | |||
+ | < | ||
+ | sudo getty -L 9600 ttyUSB0 vt102 | ||
+ | </ | ||
+ | |||
+ | This will make getty listen on the " | ||
+ | Just change ttyUSB0 to ttyS0 if you have a real serial interface in your machine. | ||
howtos/serial_console.txt · Last modified: 02/12/2018 21:34 by 127.0.0.1