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 05-03-2012, 12:10 AM   #1
xerox
Member
 
Registered: Mar 2011
Posts: 43

Rep: Reputation: 0
Unhappy capturing console (/dev/ttyS1) logs


Hi,

I have been trying to capture console logs from the init script.
When the ramfs is mounted, i check if usb is connected , if conncted, i mount it and redirected the console logs like so:

Code:
cat & /dev/ttyS1 >> /mnt/logs.txt
I'm getting

Code:
/bin/sh : /dev/ttyS1 :permission denied
I tried changing the permission to 777, but to no avail.
I also tried sudo, and found out that our ramfs does not support this command.
The console logs are still being printed on the monitor.

Please suggest a solution.

Thanks.

Last edited by xerox; 05-03-2012 at 01:52 AM.
 
Old 05-04-2012, 08:48 AM   #2
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
Does your distro have a boot logging facility such as bootlogd?
 
Old 05-08-2012, 04:52 AM   #3
xerox
Member
 
Registered: Mar 2011
Posts: 43

Original Poster
Rep: Reputation: 0
This is on an embedded device, and these logs come from ramfs.
 
Old 05-08-2012, 06:34 AM   #4
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
Quote:
Originally Posted by xerox View Post
Code:
cat & /dev/ttyS1 >> /mnt/logs.txt
Sorry -- I don't have a solution but doesn't that command (those two commands) means "run cat in the background" followed by "execute /dev/ttyS1 and append the output to /mnt/logs.txt"?

AFAIK from studying bootlogd source code too long ago for memory to serve well, intercepting writes to the console is non-trivial. I had a look for the bootlogd source code to refresh memory but could not find it.
 
1 members found this post helpful.
Old 05-08-2012, 06:45 AM   #5
xerox
Member
 
Registered: Mar 2011
Posts: 43

Original Poster
Rep: Reputation: 0
Thank you the speedy response and your precious time.

Quote:
doesn't that command (those two commands) means "run cat in the background" followed by "execute /dev/ttyS1 and append the output to /mnt/logs.txt"?
That is my intention, but nothing is happening when i do this. When i try from command line:

Code:
cat /dev/ttyS1 >> sample.txt
It hangs...

Also in our ramfs, we are printing logs to screen using DEBUG1L(); function.
Capturing this is my ultimate aim.

Also any suggestion to diagnose this problem better is welcome.

Last edited by xerox; 05-08-2012 at 07:08 AM.
 
Old 05-08-2012, 06:52 AM   #6
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,576
Blog Entries: 31

Rep: Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195Reputation: 1195
Quote:
Originally Posted by xerox View Post
Thank you the speedy response and your precious time.

Will this make any difference?

Code:
cat /dev/ttyS1 >> /mnt/logs.txt &
I believe i have tried this as well, i'll try once more.
Better but unlikely to work because you want to capture writes to /dev/ttyS1, not output from it (whatever that means -- AFAIK the keyboard input goes via a complex route through the kernel).

Ideas for a solution could come from the bootlogd source code .. but where is it?!
 
  


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
Connect to /dev/ttyS1? atziazas Linux - Newbie 5 07-06-2009 08:56 AM
CAnnot access /dev/ttys1 with Minicom on Korn Shell Yves Plasse Linux - Newbie 4 01-10-2009 11:55 AM
logs sent to /dev/console appear on /dev/tty1 lfur Linux - General 3 01-08-2008 01:19 PM
creating /dev/ttyS0 or ttyS1 MToloo Linux - Hardware 3 03-05-2007 09:09 AM
No such device /dev/ttyS1 gsancho Debian 3 09-23-2004 05:40 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:10 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