konsole showing output from unidentified background processes and syslogs?


I have a Konsole tab that shows syslog output (e.g. when I dis/connect a USB device) and now also output that appears to be from helper KF5 apps (launched by kded5?), for instance

org.kde.kwindowsystem: Loaded plugin "/opt/local/share/qt5/plugins/kf5/org.kde.kwindowsystem.platforms/" for platform "xcb"
Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)

I'm not complaining about it, but I have often wondered why this happens, and why it's always the same tab (which isn't even the 1st Konsole tab that gets opened; it currently has `tty`==/dev/pts/2). I don't see any other application that uses the same device as its standard output.

Anyone got the explanation?



Re: konsole showing output from unidentified background processe

By Duncan at 05/13/2018 - 02:07

René J.V. Bertin posted on Sat, 12 May 2018 10:44:34 +0200 as excerpted:

I've half an explanation, hopefully enough to point you in the right
direction for more. But I've never had to bother too much with it myself
so am fuzzy on the detail, and am too tired to make sense of anything I
did try to read (or look up in my own config), let alone explain once I
did, ATM, anyway. But hopefully it'll at least be enough to check a bit
of your own config and provide a start for a google, if necessary.

There's the notion of a "system console" that gets various higher
priority kernel log messages, and a similar "console log" setting for
most syslog daemons including systemd's journald. These are normally
routed to a text terminal, termed the "system conosle", but they can be
routed to a pseudoterm device like that utilized by text terminals such
as konsole, as well. Additionally, there are X-based utilities that will
display them in an X-window as well.

Presumably you have one or more of these configured to point to the pts
(or similar) device behind that konsole tab, and will need to figure out
what's configured that way and point it elsewhere if you want to change

Meanwhile, sometimes I have these messages (the kernel level ones, not
general syslog) overwriting my CLI login sessions and would like to point
them elsewhere so they quit getting in the way, but the irritation has
never been enough to actually go researching further myself (I just
grumble and hit refresh if need be), so if you happen to find a helpful
article on the topic, please post a link. That might be the perfect
"round tuit" that I never seem to get, otherwise. =:^)

Re: konsole showing output from unidentified background processe

By =?utf-8?Q?Ren=C... at 05/13/2018 - 03:33


Yes, I remember there used to be (= I used to use) such a thing, but IIRC that went through /dev/console. On the current system, that device is +rw for root only, and output sent there doesn't show up on the "infected" pseudo-terminal.

I just realised that this will help:

%> sudo ll /proc/*/fd/* | fgrep /pts/2

That showed kdeinit5 (and its klauncher child) as the source of the KF5-related message:
3697254 lrwx------ 1 bertin bertin 64 May 7 16:09 /proc/28256/fd/1 -> /dev/pts/2
3697255 lrwx------ 1 bertin bertin 64 May 7 16:09 /proc/28256/fd/2 -> /dev/pts/2
3697277 lrwx------ 1 bertin bertin 64 May 7 16:09 /proc/28257/fd/1 -> /dev/pts/2
3697278 lrwx------ 1 bertin bertin 64 May 7 16:09 /proc/28257/fd/2 -> /dev/pts/2

I cannot remember restarting kdeinit5 by hand from that termial. Is it possible that these /dev/pts devices get reused, i.e. that a Konsole tab finds itself using a pseudo-terminal devicec that's already being used as stdout/stderr by another process?


Re: konsole showing output from unidentified background processe

By =?UTF-8?Q?Nicol... at 05/15/2018 - 19:45

2018-05-13 4:33 GMT-03:00 René J.V. Bertin < ... at gmail dot com>:
Starting a KF5 graphical app from a Konsole tab may launch helper
processes, which will then keep outputting to that terminal tab even
after the original graphical app you started has quit. It's probably