[CentOS] Pipe into logger duplicates messages in /var/log/messages

Tue Mar 4 17:31:12 UTC 2014
SilverTip257 <silvertip257 at gmail.com>

On Tue, Mar 4, 2014 at 4:59 AM, John Doe <jdmls at yahoo.com> wrote:

> From: Alexander <thahartner at gmail.com>
>
> > However the following command :
> > echo "HI" > logger -t test
> > Resulted in the message appearing twice in /var/log/messages on my
> CentOS 6
> > system.
>

I don't get duplicates on a CentOS 6 x86_64 VM of mine.

Either one example (below) will suffice ... obviously eliminating the pipe
is probably best.
logger "blah" -t test
echo "hi" | logger -t test

And it doesn't matter which user I'm logged in as (privileged or
non-privileged, it logs things just the same).

Unless of course you wanted to log the contents of a file, then pipe it!
~]# cat /tmp/blah
test one
test two
test three
test four

~]# cat /tmp/blah | logger -t test

~]# tail -f /var/log/messages


> Tested on CentOS 5.10 32bits/64bits and 6.5 64bits and I only get one
> appearance...
> Did you modify /etc/syslog.conf ?
> Maybe there are two entries repeating the same facility?
>

The OP is using CentOS 6 which has replaced sysklogd with rsyslog.


>
> JD
> _______________________________________________
> CentOS mailing list
> CentOS at centos.org
> http://lists.centos.org/mailman/listinfo/centos
>



-- 
---~~.~~---
Mike
//  SilverTip257  //