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.

2
  • 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.
    – Anonymous
    Commented Feb 12, 2011 at 17:38
  • Possible same on askubuntu: askubuntu.com/questions/289537/… Commented Feb 13, 2015 at 6:30

2 Answers 2

2

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

1
  • technically it's done in the session startup scripts, or by GDM if that is used.
    – Keith
    Commented Feb 17, 2011 at 3:31
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!

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .