LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-28-2013, 04:50 PM   #1
priyadarshan
Member
 
Registered: Feb 2009
Location: Ahmedabad, Gujarat, India
Posts: 197

Rep: Reputation: Disabled
Linux serial console logging


Hi,

I am trying to develop the workaround for the following scenario...

System boots up and rarely it crashes while executing startup sequence...

All I am gonna do is to develop a script to monitor the screen output and if it stops at certain line I am gonna restart the system...

Untill now I tried with putting in the following line

cat /dev/ttyS0 > file.txt

in init.d where sequence of other binaries are present... But it just stuck there after the mentioned line...

I tried by
cat /dev/ttyS0 > file.txt &

but it seems to getting stopped and resulting into empty file...

Please let me know where I am doing it wrong...

Thanks...
 
Old 08-28-2013, 05:12 PM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: CentOS 6 (pre-systemd)
Posts: 2,610

Rep: Reputation: 702Reputation: 702Reputation: 702Reputation: 702Reputation: 702Reputation: 702Reputation: 702
Would it not be better to figure out why it is crashing?
 
Old 08-28-2013, 06:02 PM   #3
priyadarshan
Member
 
Registered: Feb 2009
Location: Ahmedabad, Gujarat, India
Posts: 197

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by smallpond View Post
Would it not be better to figure out why it is crashing?
Yes it would be... but we are looking for temporary makeshift solution...
 
Old 08-28-2013, 06:25 PM   #4
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=14, FreeBSD_10{.0|.1|.2}
Posts: 3,880
Blog Entries: 1

Rep: Reputation: 1998Reputation: 1998Reputation: 1998Reputation: 1998Reputation: 1998Reputation: 1998Reputation: 1998Reputation: 1998Reputation: 1998Reputation: 1998Reputation: 1998
Quote:
Originally Posted by smallpond View Post
Would it not be better to figure out why it is crashing?
Quote:
Originally Posted by priyadarshan View Post
Yes it would be... but we are looking for temporary makeshift solution...
I cannot imagine a rationale in which that could apply, so I won't try...

But if it saves you some time, your line

Code:
cat /dev/ttyS0 > file.txt
...does not do anything useful. It tells the the system to wait for input from /dev/ttyS0 (hang, as you say) and send whatever is typed to file.txt.

But any such action within the init sequence would be pretty pointless and the result dependent on where it was in that sequence - before or after filesystems were mounted, whether mounted readonly, the total context of the as-yet-not-fully-inited system.
 
1 members found this post helpful.
Old 08-28-2013, 07:57 PM   #5
priyadarshan
Member
 
Registered: Feb 2009
Location: Ahmedabad, Gujarat, India
Posts: 197

Original Poster
Rep: Reputation: Disabled
Quote:
Code:
cat /dev/ttyS0 > file.txt
...does not do anything useful. It tells the the system to wait for input from /dev/ttyS0 (hang, as you say) and send whatever is typed to file.txt.
Thanks.... atleast I got some hint...
 
Old 08-28-2013, 09:30 PM   #6
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=14, FreeBSD_10{.0|.1|.2}
Posts: 3,880
Blog Entries: 1

Rep: Reputation: 1998Reputation: 1998Reputation: 1998Reputation: 1998Reputation: 1998Reputation: 1998Reputation: 1998Reputation: 1998Reputation: 1998Reputation: 1998Reputation: 1998
You are welcome.

It really isn't possible to provide any meaningful help the way that you have described the problem.

And I and most others (as if I can speak for them) would be reluctant to spend time troubleshooting a makeshift workaround while knowing that another problem existed, but not knowing anything about it - potentially a huge time waster!

If you would like to get help troubleshooting the actual problem then please post the GNU/Linux version, kernel version, basic hardware and a good description of what happens when the boot fails, with some output from dmesg and syslog.

Good luck!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
linux installation without display / serial console only Amaranthus Linux - Newbie 3 12-28-2009 05:43 AM
serial console +plx tech console server card pankajd Linux - Hardware 1 10-14-2009 02:45 PM
LXer: Tech Tip: Setup Your Linux Server to Use a Serial Console LXer Syndicated Linux News 0 07-07-2009 09:20 PM
Configure serial console on LIVE linux box? TotalDefiance Linux - Software 2 05-01-2006 01:11 PM


All times are GMT -5. The time now is 12:14 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration