Where does standard output go in ubuntu / gnome auto started scripts?

1

i have a script being started with gnome. that script is set to autostart with gnome automatically via system > preferences > startup applications. so where does the standard output of such an auto started program go?

To add some background information: I want to debug by analyzing the program's messages printed to its standard output. Just looking for the place where it goes. I remember, that the output is shown in the console when restarting gdm, but something like cat /dev/vcs7 does not help.

alex

Posted 2011-02-12T15:47:11.507

Reputation: 113

Possible same on askubuntu: http://askubuntu.com/questions/289537/how-can-i-view-stdout-stderr-of-a-startup-application

– Ciro Santilli 新疆改造中心法轮功六四事件 – 2015-02-13T06:30:49.940

to add some background information: i want to debug by analyzing the program's messages printed to its standard output. just looking for the place where it goes. i remember, that the output is shown in the console when restarting gdm. but something like cat /dev/vcs7 does not help. – None – 2011-02-12T17:38:30.957

Answers

2

stdout and stderr are eventually redirected in the X startup to ~/.xsession-errors, so all its children have that redirection as well.

Ignacio Vazquez-Abrams

Posted 2011-02-12T15:47:11.507

Reputation: 100 516

technically it's done in the session startup scripts, or by GDM if that is used. – Keith – 2011-02-17T03:31:53.087

0

You could redirect normal and error output at the beginning of your script like this:

#!/bin/bash

exec > /tmp/$0.$$.log 2>&1

...

echo "This text would go into the .log file"

Then when the script gets executed you'll be able to peek into the corresponding log file and see what's going on.

I hope this helps you!

davidag

Posted 2011-02-12T15:47:11.507

Reputation: 202