nixCraft Linux Forum

nixCraft

Linux Tech Support Forum

How to redirect Output

This is a discussion on How to redirect Output within the Shell scripting forums, part of the Development/Scripting category; Dear All. I have download a script from this path "http://www.cyberciti.biz/tips/wp-content/uploads/2006/06/fw.proxy.txt" and my Squid working as transparent proxy and also ...


Go Back   nixCraft Linux Forum > Development/Scripting > Shell scripting

Register FAQ Members List Calendar Mark Forums Read
  #1 (permalink)  
Old 12-01-2006, 06:56 PM
Member
User
 
Join Date: Mar 2006
Posts: 63
Rep Power: 0
puppen
Default How to redirect Output

Dear All.

I have download a script from this path "http://www.cyberciti.biz/tips/wp-content/uploads/2006/06/fw.proxy.txt" and my Squid working as transparent proxy and also this script is working fine but the only problem is that, output from this script is continuously coming on all console so how do I redirect this out to /dev/null or any other way so that my console will be clean.

Regards.

Puppen
__________________
someone somewhere is made for you.
LOVE is Journey not a destination.
ALL I want is EVERYTHING.
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 12-01-2006, 07:15 PM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
My distro: Any distro with shell
Posts: 967
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

How do you run script? This will only send output to console if syslogd is configured to send iptables output. Do you see packet drop messages?
__________________
Vivek | My personal blog
Linux Evangelist
Play hard stay cool
Reply With Quote
  #3 (permalink)  
Old 12-01-2006, 07:32 PM
Member
User
 
Join Date: Mar 2006
Posts: 63
Rep Power: 0
puppen
Default

Dear niXcraft.

I run this script through this command ./scriptname and the ouput at the console is
IN=eth1 OUT=MAC=ff:ff:ff:ff:00:10:7c:8a SRC=04.57.76.85.104 LEN=48 TOS=0x00 PREC=0x00 TTL 105 ID=50853 PROTO=udp SPT=1026 DPT=1046....
like that only.

Regards.
Puppen
__________________
someone somewhere is made for you.
LOVE is Journey not a destination.
ALL I want is EVERYTHING.
Reply With Quote
  #4 (permalink)  
Old 12-01-2006, 08:11 PM
Member
User
 
Join Date: Mar 2006
Posts: 63
Rep Power: 0
puppen
Default

Hello niXcraft.

Pls reply .... , I am waiting for your reply


Regards.
Puppen
__________________
someone somewhere is made for you.
LOVE is Journey not a destination.
ALL I want is EVERYTHING.
Reply With Quote
  #5 (permalink)  
Old 12-02-2006, 02:46 AM
rockdalinux's Avatar
Contributors
User
 
Join Date: May 2005
Location: Bangalore
My distro: RHEL, HP-UX, Solaris, FreeBSD, Ubuntu
Posts: 578
Rep Power: 7
rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough
Default

Solution # 1
Find line
Code:
iptables -A INPUT -j LOG
Remove the same. It should fix the problem. and restart script

Solution # 2
You can modify /etc/syslog.conf file. Following is default for RHEL Backup your exisiting file and put following and restart script. Now all packets should go to /var/log/messages

Code:
# Log all kernel messages to the console.
# Logging much else clutters up the screen.
#kern.*                                                 /dev/console
# Log anything (except mail) of level info or higher.
# Don't log private authentication messages!
*.info;mail.none;authpriv.none;cron.none                /var/log/messages
# The authpriv file has restricted access.
authpriv.*                                              /var/log/secure
# Log all the mail messages in one place.
mail.*                                                  -/var/log/maillog
# Log cron stuff
cron.*                                                  /var/log/cron
# Everybody gets emergency messages
*.emerg                                                 *
# Save news errors of level crit and higher in a special file.
uucp,news.crit                                          /var/log/spooler
# Save boot messages also to boot.log
local7.*
__________________
Rocky Jr.
You may have my body & soul, but you will never touch my pride!

If you have knowledge, let others light their candles at it.

Certified to work on HP-UX / Sun Solaris / RedHat
Reply With Quote
  #6 (permalink)  
Old 12-02-2006, 02:53 AM
nixcraft's Avatar
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
My distro: Any distro with shell
Posts: 967
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

Quote:
Originally Posted by puppen
Hello niXcraft.

Pls reply .... , I am waiting for your reply
Sorry for delay, been busy with workload. Just follow rocky's #1 solution or open file /etc/syslog.conf or /etc/syslogd.conf and find out line which read as follows:
Code:
kern.*                                                 /dev/console
Comment out above line
Code:
#kern.*                                                 /dev/console
And restart syslogd
Code:
/etc/init.d/syslogd restart
__________________
Vivek | My personal blog
Linux Evangelist
Play hard stay cool
Reply With Quote
  #7 (permalink)  
Old 12-02-2006, 02:23 PM
Member
User
 
Join Date: Mar 2006
Posts: 63
Rep Power: 0
puppen
Default

Dear nixCraft & Rocky.

Both the solutions are not working, I have tried it.

Is there any solution.

Regards.

Puppen
__________________
someone somewhere is made for you.
LOVE is Journey not a destination.
ALL I want is EVERYTHING.
Reply With Quote
  #8 (permalink)  
Old 12-02-2006, 08:54 PM
rockdalinux's Avatar
Contributors
User
 
Join Date: May 2005
Location: Bangalore
My distro: RHEL, HP-UX, Solaris, FreeBSD, Ubuntu
Posts: 578
Rep Power: 7
rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough
Default

Hello,

That is weird. Which distro you are using? Did you restart everything after changes? Login as normal user, if you don't see message than you are fine. Many distro turn on login for root user on console but for normal user there should not be any such message!
__________________
Rocky Jr.
You may have my body & soul, but you will never touch my pride!

If you have knowledge, let others light their candles at it.

Certified to work on HP-UX / Sun Solaris / RedHat
Reply With Quote
  #9 (permalink)  
Old 12-02-2006, 09:37 PM
Member
User
 
Join Date: Mar 2006
Posts: 63
Rep Power: 0
puppen
Default

Dear Rocky.

I am using RHEL4.0, I have not checked with other users all console message are coming on root login.


regards.
Puppen
__________________
someone somewhere is made for you.
LOVE is Journey not a destination.
ALL I want is EVERYTHING.
Reply With Quote
  #10 (permalink)  
Old 12-02-2006, 09:55 PM
Member
User
 
Join Date: Mar 2006
Posts: 63
Rep Power: 0
puppen
Default

Dear Rocky.

My problem is that when ever I do something I use root login, as soon as I login console message are coming and frequency is so high that what ever I type I just went away with these messages,
U can not type on console

Is there any solution ???????????????????
__________________
someone somewhere is made for you.
LOVE is Journey not a destination.
ALL I want is EVERYTHING.
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
Apache Redirect / to index.php using mod_rewrite .htaccess kasimani Web servers 1 04-18-2008 11:17 PM
About iptables output satimis Networking, Firewalls and Security 0 09-30-2007 08:30 AM
Redirect + Rewrite Problem in Lighttpd Lizard King Web servers 4 07-17-2007 09:44 AM
redirect to www in lighttpd muks Web servers 11 06-02-2007 10:55 PM
How can I redirect the output of time command to file warren Linux software 13 08-25-2006 11:17 AM


All times are GMT +5.5. The time now is 06:08 AM.


Powered by vBulletin® Version 3.7.3 - Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36