Posts Tagged ‘pipe’

How create and use pipes in Linux

April 22nd, 2010 No comments

Create a named pipe using mkfifo: mkfifo -p /var/adm/syslog.pipe

Make syslog.conf to points to this file (for example /var/adm/syslog.pipe)

*.info                        |/var/adm/syslog.pipe

Relaunch syslogd:
  kill -HUP `cat /var/run/`

Create processing script that read the pipe. It should run constantly and be launched from RC scripts

cat /var/adm/syslog.pipe | grep -v “denied update from” | while read LINE
  echo $LINE >>/var/adm/denied_update.log

Categories: Linux Tags: ,