Any way to view stdout of a program after it has been started in gnome-shell?

4

1

So, if I run a program through the menus in gnome-shell, is there a way to view stdout and stderr? Or is there some kind of hack to achieve this functionality?

Or is everything just sent to /dev/null?

bobbaluba

Posted 2013-06-13T04:56:37.883

Reputation: 306

Answers

5

Usually, gdm/session start-up scripts redirect stderr & stdout to either:

~/.xsession-errors

or

~/.cache/gdm/session.log

With systemd and recent gdm versions, everything is redirected to systemd journal, so one way to get that output is:

journalctl -b _PID=$(pgrep gnome-session)

don_crissti

Posted 2013-06-13T04:56:37.883

Reputation: 2 374

I think gnome-session doesn't necessarily run anymore (I'm on gnome 3.14, because pgrep doesn't find it, though I'm definitely in gnome ;) – ufotds – 2015-02-09T05:09:10.803

@ufotds - it all depends on your particular setup, but on a normal gnome setup it definitely runs (I'm on a vanilla gnome 3.14.2 install and pgrep gnome-session works fine). – don_crissti – 2015-02-09T10:20:06.650

2

The command suggested by don_crissti didn't show anything for me, but I just do:

journalctl -f

in a terminal tab that I always leave open (and opens automatically on boot) so I have realtime feedback of all logging from systemd on my computer.

If desired, you can use the match filters from journalctl to limit the noise, but for now I like to have everything at hand.

ufotds

Posted 2013-06-13T04:56:37.883

Reputation: 581