Serial Terminal as Console
A frequently asked, but never completely answered, question in the comp.os.linux.* newsgroups and other Linux mailing lists, is the one about cheap, headless Linux boxes. It seems that many people need to install Linux boxes without a video card, a monitor or a keyboard.
A cheap response to this problem is to use a serial terminal (Wyse or Ampex, for example) as the main Linux console. This cuts the cost of a keyboard, a video card and a monitor. I've done this very thing on my second computer, an old 486 VLB, by using a Wyse 60 terminal.
Linking a terminal to your computer's serial port is not at all difficult. You can easily follow the instructions in the Serial-HOWTO and in the inittab(5) and agetty(8) man pages. Here's a short summary.
First, you must use a null modem cable.
Second, insert the following line in your /etc/inittab file, if you're using agetty. Other getty programs, like getty_ps, use a different syntax.
ID:RUNLEVELS:respawn:/sbin/agetty -L SPEED TTY TERM
ID = a two character identifier, e.g., s1 or s2
RUNLEVELS = Runlevels in which the terminal must be active
SPEED = serial port speed
TTY = tty port name relative to the /dev directory
TERM = value to be used for the TERM environment variable
My machine's /etc/inittab has the following line:
s2:12345:respawn:/sbin/agetty -L 9600 ttyS1 vt100
for a serial terminal on the /dev/ttyS1 port (COM2 for DOS users), with a port speed of 9600 BPS and vt100 terminal emulation (which seems to run better than native Wyse 60 mode).
Finally, restart init with the command init q.
If you correctly followed these three simple steps, you should see the login prompt on your terminal screen. You can log in and work on your machine in the same way you can when you're actually on the console or telneting from a remote host.
The messages the kernel shows at boot time are always directed to your main console (tty1). If you turn on your headless box, you can only wait for the login on the terminal, which means losing those precious messages. You can see them by using the dmesg command, but usually you need them before the login shell comes up.
There are other messages on your console: those generated by the scripts in the /etc/rc.d directory, and from scripts run at boot and shutdown time. How can you really know that “the system is halted” if you can't read it on a monitor?
You must patch the /usr/src/linux/drivers/char/console.c program in your kernel source tree. It's not a complex kernel hack. You can follow these three simple steps.
First, define the CONFIG_SERIAL_ECHO symbol at program start:
Second, modify the address of the terminal serial port (only if you're using a port different from that defined by default) looking for the following line:
#define SERIAL_ECHO_PORT 0x3f8 /* COM1 */In my machine I've changed that line to:
#define SERIAL_ECHO_PORT 0x2f8 /* COM2 */Third, rebuild your kernel and reboot: you should see on your terminal screen the kernel messages during your system's hardware devices probe.
Please note that these steps work for a 2.0.0 kernel, not on 1.2.13. I haven't yet had time to try other kernels. The console.c patch is necessary for all Linux ports except the one for Alpha, which contains it in the make config with the following option:
Echo console messages on /dev/ttyS1
To show these messages on your terminal, you can append > TTY to every line of these files that contains the command echo. TTY is the terminal serial port (the same one used in /etc/inittab serial terminal line).
If you want to choose among more than two kernel images, you have to modif the LILO configuration file, /etc/lilo.conf.
Complete instructions for seeing the LILO prompt on serial terminals can be found in the /usr/doc/lilo/README file (look for the SERIAL option). Here are two steps to do that correctly.
First, edit the /etc/lilo.conf file and insert a SERIAL option line after the BOOT option line:
serial=SERIAL_LINE,SPEED PARITY BITS
SERIAL_LINE = 0 (com1) 1 (com2) 2 (com3) 3 (com4) SPEED = serial port speed PARITY = n (= none) o (= odd) e (= even) BITS = bits in a character (8 or 7)Please note that there are no spaces between the SPEED, PARITY and BITS parameters. These must be equal to the ones defined in your terminal setup. Here's the line used by my machine's LILO:
serial=1,9600n8This line means COM2 at 9600 BPS, no parity, 8 bits per character.
Second, execute the lilo command to update your system's configuration.
Using the SERIAL option, LILO sets a two second delay (the same as when you put a delay = 20 line in the lilo.conf file) before booting the default kernel image. During this pause, you can interrupt the boot process and get the LILO prompt by sending a break to the terminal as you press the SHIFT key on your main console.
Practical Task Scheduling Deployment
July 20, 2016 12:00 pm CDT
One of the best things about the UNIX environment (aside from being stable and efficient) is the vast array of software tools available to help you do your job. Traditionally, a UNIX tool does only one thing, but does that one thing very well. For example, grep is very easy to use and can search vast amounts of data quickly. The find tool can find a particular file or files based on all kinds of criteria. It's pretty easy to string these tools together to build even more powerful tools, such as a tool that finds all of the .log files in the /home directory and searches each one for a particular entry. This erector-set mentality allows UNIX system administrators to seem to always have the right tool for the job.
Cron traditionally has been considered another such a tool for job scheduling, but is it enough? This webinar considers that very question. The first part builds on a previous Geek Guide, Beyond Cron, and briefly describes how to know when it might be time to consider upgrading your job scheduling infrastructure. The second part presents an actual planning and implementation framework.
Join Linux Journal's Mike Diehl and Pat Cameron of Help Systems.
Free to Linux Journal readers.Register Now!
- SUSE LLC's SUSE Manager
- Murat Yener and Onur Dundar's Expert Android Studio (Wrox)
- My +1 Sword of Productivity
- Managing Linux Using Puppet
- Non-Linux FOSS: Caffeine!
- SuperTuxKart 0.9.2 Released
- Doing for User Space What We Did for Kernel Space
- Google's SwiftShader Released
- Parsing an RSS News Feed with a Bash Script
- Rogue Wave Software's Zend Server
With all the industry talk about the benefits of Linux on Power and all the performance advantages offered by its open architecture, you may be considering a move in that direction. If you are thinking about analytics, big data and cloud computing, you would be right to evaluate Power. The idea of using commodity x86 hardware and replacing it every three years is an outdated cost model. It doesn’t consider the total cost of ownership, and it doesn’t consider the advantage of real processing power, high-availability and multithreading like a demon.
This ebook takes a look at some of the practical applications of the Linux on Power platform and ways you might bring all the performance power of this open architecture to bear for your organization. There are no smoke and mirrors here—just hard, cold, empirical evidence provided by independent sources. I also consider some innovative ways Linux on Power will be used in the future.Get the Guide