You are not logged in.

#1 2012-05-22 05:42:33

Archdove
Member
Registered: 2011-09-23
Posts: 118

[SOLVED] Read tty2 messages after rebootq

Hi

We've a software which causes a SIGSEGV and stops working. This seems only to be logged in the standard output an therefore only to the tty where i started it.
Is there a way to access old messages on tty? Like from two days (one reboot) ago?

Regards, Archdove

Last edited by Archdove (2012-05-29 12:59:17)

Offline

#2 2012-05-22 08:51:23

Unia
Member
From: Stockholm, Sweden
Registered: 2010-03-30
Posts: 2,486
Website

Re: [SOLVED] Read tty2 messages after rebootq

Check your logs in /var/log/

Last edited by Unia (2012-05-22 08:51:50)


If you can't sit by a cozy fire with your code in hand enjoying its simplicity and clarity, it needs more work. --Carlos Torres

Offline

#3 2012-05-22 09:07:25

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,868

Re: [SOLVED] Read tty2 messages after rebootq

Archdove, in case /var/log doesn't have the info you need, redirecting output from the problem software (foo) to a file seems the easiest way to get it.

create an empty textfile, say foo-output.txt

start foo like this :

foo >> foo-output.txt
This will append all output of foo to foo-output.txt

if foo has any debug or loglevel options, also add them to the command.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#4 2012-05-22 11:28:26

Archdove
Member
Registered: 2011-09-23
Posts: 118

Re: [SOLVED] Read tty2 messages after rebootq

Hey Guys

/var/log/ does not contain anything for that matter. For now i will activate ptrace and pipe stdout to a textfile.

Offline

#5 2012-05-23 15:50:48

Archdove
Member
Registered: 2011-09-23
Posts: 118

Re: [SOLVED] Read tty2 messages after rebootq

Piping did not help. The SIGSEGV error was still printed to stdout and thus into the terminal window. Too bad.
Maybe there is another way? ... The system is Rebooting at 4am and i can't do anything about that ...

Offline

#6 2012-05-23 15:54:41

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,442
Website

Re: [SOLVED] Read tty2 messages after rebootq

"normal" pipes or redirects only redirect the stdout.  Errors do not go to stdout, they go to stderr.

Try

foo > log.text 2>&1

This redirects the stdout to a log and the stderr to the stdout, which then goes to the log file.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#7 2012-05-29 05:52:20

Archdove
Member
Registered: 2011-09-23
Posts: 118

Re: [SOLVED] Read tty2 messages after rebootq

@Trilby: That sounds sane. Can you provide me a hint about what to google to learn more about what you're doing there?

2>&1

Last edited by Archdove (2012-05-29 05:53:18)

Offline

#8 2012-05-29 07:28:08

fracek
Member
From: Italy
Registered: 2012-05-27
Posts: 5

Re: [SOLVED] Read tty2 messages after rebootq

Archdove wrote:

@Trilby: That sounds sane. Can you provide me a hint about what to google to learn more about what you're doing there?

He's using redirections, you can learn more on the bash manual.

Offline

Board footer

Powered by FluxBB