Alexander
2014-Mar-04 05:34 UTC
[CentOS] Pipe into logger duplicates messages in /var/log/messages
I am trying to pipe the output from a process into syslog using the logger command. Initially I pipe the output into a separate file, but as it happens this filled up the disk when things went wrong. So I figured I redirect the output to syslog and let logrotate deal with the roll-over and archive of the file. 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 tested it on Gentoo as well where it behaved correctly, only showing a single message. Any pointers on why CentOS duplicates these messages. Alex
David Benfell
2014-Mar-04 05:58 UTC
[CentOS] Pipe into logger duplicates messages in /var/log/messages
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 On 03/03/2014 09:34 PM, Alexander wrote:> I am trying to pipe the output from a process into syslog using the > logger command. Initially I pipe the output into a separate file, > but as it happens this filled up the disk when things went wrong. > So I figured I redirect the output to syslog and let logrotate deal > with the roll-over and archive of the file. > > However the following command : > > echo "HI" > logger -t testWhat are the contents of the file HI in the working directory from which you ran this command? (I think you mean `echo "HI" | logger -t test`.) - -- David Benfell see https://parts-unknown.org/node/2 if you don't understand the attachment -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBCgAGBQJTFWubAAoJEBV64x4SNmArD5kP/0HgMyYUkdrnntdO+zPUf9t6 QrKdGsSPhy2md/AN66B2s2BBk5wYnP3oMPJi+VGDjes8mlLK6hxdfJSVj/hAS+YY saOxTQwe8AlTP3nbbJbzmdER3qJ/wYn6SDMXedQlErgLZ1sl2ZF7dcKvxXLQqPu0 W/Cn1gCymLino6AgH8inCDaqyAeQHS0QVM0a718ajrafACvbZOutbqbqCiv/syQR XzX+gCPmy2lGdLfqEFntLau6A/uH0EMVBnB0qhKf2LeUc+t0uemdURguICeKQiR3 tFEbC+yDunZyj2TpJLl0c+yAPQZvmCjULRqRBvyWbN0Ehkz7PXN+dDO+iT2ECtOw KfHpTMJBwYvkxjFzzAZxQ4QVqcAMqc4XtBRWxeRyqntKwJ2xYCET7cvyUAlt0khO Qjmz17DDR3AVGHpn2LIxmp2pUx8/thfoNMDR477AL51WKrESibIpPhvX5Tk3LpyY GJJhtr5cqYJUZLSYnqXgp3U6ZmO4uA3DwuvCp8kY7/YcLTysx8wj4xl488c4fmfc LTDmBcfL2lAld8BcXHtXkuKFOIkzaBpybDEUnVbigQ5gxkL9bKrK2Ew2W+Wef56D JHiRfXEG5GoxIrQ42ojXew92fIpt47f71Y7VXhmVYaGrumr1C6CYTh2GhlzpbDQa fyzHNPPUulsW4qRSmrF5 =cks2 -----END PGP SIGNATURE-----
John Doe
2014-Mar-04 09:59 UTC
[CentOS] Pipe into logger duplicates messages in /var/log/messages
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.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? JD