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 01-17-2007, 07:34 PM   #1
procfs
Member
 
Registered: Jan 2006
Location: Sri Lanka
Posts: 608

Rep: Reputation: 34
Redirect console out put to a file


HI

I am tring to capture the console out put to a file so used

service smb restart > 123 2>&1

but there are some ICMP errors that comes on the screen but not in to the file 123.

How am I to captute all that is commings on to console


Thank you

Regards

Asanka
 
Old 01-17-2007, 07:48 PM   #2
Rickead2000
LQ Newbie
 
Registered: Jul 2002
Posts: 24

Rep: Reputation: 15
Simply

Code:
service smb restart > 123
Would store the input from service smb restart into the file 123
 
Old 01-17-2007, 07:55 PM   #3
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
I would have thought that OP's version would work.

BUT--does smb restart produce any output?? What happens if you just run it without any redirection?
 
Old 01-17-2007, 08:13 PM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,332
Blog Entries: 55

Rep: Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533
and are you sure those ICMP messages are generated by Samba and not say the kernel?
 
Old 01-17-2007, 08:51 PM   #5
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,877

Rep: Reputation: 350Reputation: 350Reputation: 350Reputation: 350
Would

service smb restart | tee 123

also produce the desired result?

It would show the output on standard output, as well as write the output to file 123.
 
Old 01-17-2007, 09:23 PM   #6
procfs
Member
 
Registered: Jan 2006
Location: Sri Lanka
Posts: 608

Original Poster
Rep: Reputation: 34
I started the samba after putting !/bin/bash -x in /etc/init.d/smb so I get lots of debuging info. That info I can capture in a file but at the time of shutdown and start of samb I get a ICMP error that part wold not go to the file

Thing is I get this ICMP errors all the time on my console. I want to know why. If I can redirect the out put at least to submit a report.

Jan 14 04:03:00 avadbasvl1 kernel: 172.16.84.129 sent an invalid ICMP type 3, code 3 error to a broadcast: 172.16.87.255 on bond0
Jan 14 04:03:00 avadbasvl1 kernel: 172.16.85.4 sent an invalid ICMP type 3, code 3 error to a broadcast: 172.16.87.255 on bond0
Jan 14 04:03:00 avadbasvl1 kernel: 172.16.85.5 sent an invalid ICMP type 3, code 3 error to a broadcast: 172.16.87.255 on bond0
Jan 14 04:03:00 avadbasvl1 kernel: 172.16.84.236 sent an invalid ICMP type 3, code 3 error to a broadcast: 172.16.87.255 on bond0
Jan 14 04:03:00 avadbasvl1 kernel: 172.16.84.137 sent an invalid ICMP type 3, code 3 error to a broadcast: 172.16.87.255 on bond0
Jan 14 04:03:00 avadbasvl1 kernel: 172.16.87.207 sent an invalid ICMP type 3, code 3 error to a broadcast: 172.16.87.255 on bond0
Jan 14 04:03:00 avadbasvl1 kernel: 172.16.85.11 sent an invalid ICMP type 3, code 3 error to a broadcast: 172.16.87.255 on bond0
Jan 14 04:03:00 avadbasvl1 kernel: 172.16.85.10 sent an invalid ICMP type 3, code 3 error to a broadcast: 172.16.87.255 on bond0
Jan 14 04:03:00 avadbasvl1 kernel: 172.16.84.139 sent an invalid ICMP type 3, code 3 error to a broadcast: 172.16.87.255 on bond0


Thank you all

Regards

Asanka
 
Old 01-18-2007, 07:26 AM   #7
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,332
Blog Entries: 55

Rep: Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533Reputation: 3533
I started the samba after putting !/bin/bash -x in /etc/init.d/smb so I get lots of debuging info.
No, that would get you the debug info for the script itself. If you want to debug the SMB daemon binary you would need to attach strace (or have debuginfo packages installed IIRC). If you want to debug the SMB process (which you do) you should start smbd with the appropriate "-d" flag ('man 8 smbd'?).


at the time of shutdown and start of samb I get a ICMP error (..) Thing is I get this ICMP errors all the time on my console. I want to know why.
These are not smbd errors but kernel warnings. Where kernel warnings are logged depends on your /etc/syslog.conf. How much of kernel warnings are logged to the screen depends on your dmesg ('man 8 dmesg'?) settings. Putting "dmesg -n 4" in your shells' login script should make them disappear from the screen.

Last edited by unSpawn; 01-18-2007 at 07:28 AM.
 
Old 01-19-2007, 12:29 AM   #8
procfs
Member
 
Registered: Jan 2006
Location: Sri Lanka
Posts: 608

Original Poster
Rep: Reputation: 34
Hi unSpawn

Cam you tell me why is these messages are comming on the console. This is the first time I got these messages.

This happends only if the samba is running

Asanka
 
  


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
Serial Console-redirect to another PC adenev Linux - Newbie 2 04-01-2009 08:21 PM
Can I redirect console to another framebuffer device when machine is running twomol Linux - Software 1 06-14-2006 12:52 PM
trying to redirect text to a file to cat at later point. says file doesn't exist. dr_zayus69 Programming 1 10-02-2005 09:10 AM
How to redirect console beep with ALSA to a soundcard? zimon Linux - Software 4 10-16-2004 07:58 AM
How do I redirect something to a file without it overwriting the destination file??? nikold01 Linux - General 8 09-09-2004 03:30 PM


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