I was looking through the list of /dev/tty...
devices and came across ttyprintk
and wondered what it is. Google hasn’t helped much. I came across this which says:
The feature is useful to inline user messages with kernel messages. In order to use this feature, you should output user messages to /dev/ttyprintk or redirect console to this TTY, or boot the kernel with console=ttyprintk.
which sort of explains what it’s for but not what it is, at least, not well enough for me to understand. Can anyone elaborate?
Hi,
tty stays for’ teletype’ (Unix), terminals were typewriters connected via serial ports.
‘printk’ I guess is an abbreviation for print kernel 
printk() is a function in the kernel. The messages you see in the journal and the logs that originate from the kernel where put there by that function. /dev/ttyprintk is a (pseudo-) device which allows you to inject your own message into that stream of messages, which should be useful when trying to find out what program makes the kernel put out some message e.g. debugging start-up problems.
1 Like
If you are interested, you can test it like this:
echo "test message" | sudo tee /dev/ttyprintk
Then check the logs:
sudo dmesg | tail -n 10
You should find an entry called test message.