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/syslogd.pid`
Create processing script that read the pipe. It should run constantly and be launched from RC scripts
#!/bin/ksh
cat /var/adm/syslog.pipe | grep -v “denied update from” | while read LINE
do
echo $LINE >>/var/adm/denied_update.log
Recent Comments