Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I've been trying to understand the /dev/console device, but there are a few things I'm not clear on:

  1. What is the purpose of this device? From what I can gather it's just a place for the kernel to display messages, is that right?

  2. The virtual terminal that is assigned as the console isn't allowed to have job control. Why? Is that just because the kernel is trying to stop you from running anything else in the place that it needs to print system messages?

  3. For me, /dev/console seems to point to tty0, the current virtual console. I found this based on some simple testing and it seems to be a fairly common configuration. However, to me this indicates that tty0 should have job control disabled, which would mean that all consoles should have job control disabled, which would be bad. It's giving me a headache just thinking about it. Also, if tty0 is the console, then shouldn't I be getting kernel messages on the current terminal instead of just on tty1?

share|improve this question
add comment

2 Answers

This is largely a historical holdover from days when the operations console was an actual teletype that printed (made indelible marks) on a piece of paper (a thin flexible material made from wood fiber, often white). Over time, these have largely been directed to the syslog and dmesg facilities since very few systems now have an actual console but the information is still needed.

I don't know where you got the idea that /dev/console was tty0; on my Linux 3 box, /dev/console, tty, and ttyprintk all have a device major number of 5 while tty0 and all the rest of the pseudo-ttys are major device 4. This means that they use different drivers (or radically different modes of the same driver).

share|improve this answer
add comment

The /dev/console is an abstraction of the local terminal session - console associated with the monitor plugged into the machine.

Its purpose, mainly on servers, is to provide remote access even if the system is running in single-user mode. Such console is (in most cases) bound to the eth0 device when the eth0 networking is turned off.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.