console @ ttyS0

Asked by Phoenix on 2007-01-29


I'm running a Ubuntu/Edgy on a headless computer and like to direct all output to ttyS0. So far I have the kernel output and a shell, that's nice as long as everything works straight, but I miss all the startup information (errors, though the are logged) and more serious, if something goes wrong (meaning, doesn't reach rc2) I have no console.

what stances are needed in my /etc/event.d/ttyS0 to have it as main console? (see all the daemons starting, fsck, failback shell - all the glory things if one has a monitor is attached...)

Thanks in advance

Question information

English Edit question
Ubuntu Edit question
No assignee Edit question
Solved by:
Last query:
Last reply:
Pascal de Bruijn (pmjdebruijn) said : #1

I think you need to pass a kernel parameter for that. Google will have the exact answers.

Phoenix (phoenix-dominion) said : #2

Hi Pascal

Please read my story, I do have Kernel output - thus passed the option, but I have no output between kernel messages and the getty that gives me the login, or otherweise put, all output of the "startup" (or sysvinit) is missing.

The option you mean is: append="console=ttyS0,9600 console=tty0"

But thanks for the advice anyway!


BTW: that's the file so far - and of course, it would also be nice to have
# ttyS0 - getty
# This service maintains a getty on tty1 from the point the system is
# started until it is shut down again.

# start on startup
# start on maintenance
start on runlevel-1
start on runlevel-1
start on runlevel-2
start on runlevel-3
start on runlevel-4
start on runlevel-5

stop on shutdown

console output
respawn /sbin/getty -L ttyS0 9600 vt100

Wolf Canis (wolf-canis) said : #3

Hello Phoenix,
have you read this /usr/src/linux/Documentation/serial-console.txt or
/usr/share/doc/linux-doc-2.6.17/Documentation if you installed the linux-doc package?
I understand that so: You must build a custom kernel with serial console support build in not as module. You can do this by following the steps at:

Read it carefully, they are some difficulties. You should know this difficulties before you start. (LRM is only one)

Mr Canis

Phoenix (phoenix-dominion) said : #4

I read the document and I'm pretty shure that I followed it.

I already have a custom kernel, but beside that, I would consider it a bug when a -server kernel would not be able to provide this kind of functionality.

As of now, as soon as the OS is not able to reach successfully rc2 I won't get any output.... nor do I see any startup errors from the system-v environment. The last thing I see is:

[ 451.219481] Freeing unused kernel memory: 288k freed

... and of course after some time my serial getty appears....

Best Phoenix (phoenix-dominion) said : #5

okay, RTFM... all the way....

-- 8< --
You can specify multiple console= options on the kernel command line.
Output will appear on all of them. The last device will be used when
you open /dev/console. So, for example:

        console=ttyS1,9600 console=tty0

defines that opening /dev/console will get you the current foreground
virtual console, and kernel messages will appear on both the VGA
console and the 2nd serial port (ttyS1 or COM2) at 9600 baud.
-- 8< --

Meaning, you can have kernel output on multiple consoles, but only one can display you the init process, which is the last mentioned console in on the kernel command line. And in my case I did it exactly like the statement above and thus got no upstart output. Once I reversed the console statements it worked as I wanted it. Though be aware that you probably won't have upstart output on your monitor, which is not grave in my case at it is a virtual box anyway.

Thanks to Pascal and Mr Canis.