Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Understanding FIFO pipes and Syslog

by Plankton (Vicar)
on Oct 03, 2010 at 18:27 UTC ( #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
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? | Other CB clients
Other Users?
Others exploiting the Monastery: (4)
As of 2018-08-19 02:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Asked to put a square peg in a round hole, I would:









    Results (186 votes). Check out past polls.

    Notices?