Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Understanding FIFO pipes and Syslog

by Plankton (Vicar)
on Oct 03, 2010 at 18:27 UTC ( [id://863196]=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $ sudo mkfifo /var/log/blackhole.pipe
    
  2. or download this
    $ cat /etc/syslog.conf 
    ...
    # test logger script
    local1.*      |/var/log/blackhole.pipe
    
  3. or download this
    $ logger -p local1.info "test test"
    $ logger -p local1.info "test test"
    $ logger -p local1.info "test test"
    $ logger -p local1.info "test test2"
    
  4. or download this
    $ cat /var/log/blackhole.pipe
    Oct  3 11:16:09 localhost plankton: test test
    Oct  3 11:16:15 localhost last message repeated 2 times
    Oct  3 11:16:19 localhost plankton: test test2
    
  5. or download this
    $ cat process_blackhole.pl 
    #!/usr/bin/perl -w
    ...
    # should never really come down here ...
    close $fifo_fh;
    exit(0);
    
  6. or download this
    $ sudo ./process_blackhole.pl 
    read from pipe [Oct  3 11:22:45 localhost plankton: test test]
    read from pipe [Oct  3 11:22:52 localhost plankton: test test2]
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://863196]
Approved by biohisham
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2024-04-20 01:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found