From edb8002d22dc51ba23e523577be4b5482e2ac457 Mon Sep 17 00:00:00 2001 From: linggao Date: Thu, 24 Apr 2008 17:55:41 +0000 Subject: [PATCH] fixed message duplication in syslog git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@1190 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT/postscripts/syslog | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/xCAT/postscripts/syslog b/xCAT/postscripts/syslog index 71233a9a6..5359b7bcb 100755 --- a/xCAT/postscripts/syslog +++ b/xCAT/postscripts/syslog @@ -113,10 +113,16 @@ if ($goLocal) { if (! -f "$conf_file.XCATORIG") { `cp -f $conf_file $conf_file.XCATORIG`; } - if ($^O =~ /aix/i) { - `echo "*.debug;*.crit;*.err;*.warning /var/log/messages rotate 1024K files 5" >> $conf_file`; - } else { - `echo "*.debug;*.crit;*.err;*.warning /var/log/messages" >> $conf_file`; + `grep "xCAT settings" $conf_file`; + if ($?) { + if ($^O =~ /aix/i) { + `echo "\# xCAT settings" >> $conf_file`; + `echo "*.debug;*.crit;*.err;*.warning /var/log/messages rotate 1024K files 5" >> $conf_file`; + } + #else { + # `echo "\# xCAT settings" >> $conf_file`; + # `echo "*.debug;*.crit;*.err;*.warning /var/log/messages" >> $conf_file`; + #} } } } else { @@ -125,11 +131,16 @@ if ($goLocal) { if (! -f "$conf_file.XCATORIG") { `cp -f $conf_file $conf_file.XCATORIG`; } - `echo "destination loghost { udp(\\\"$master\\\"); };" >> $conf_file`; - `echo 'log { source(src); destination(loghost); };' >> $conf_file`; - } else { + `grep "xCAT settings" $conf_file`; + if ($?) { + `echo "\# xCAT settings" >> $conf_file`; + `echo "destination loghost { udp(\\\"$master\\\"); };" >> $conf_file`; + `echo 'log { source(src); destination(loghost); };' >> $conf_file`; + } + } else { if (-f "$conf_file.XCATORIG") { `rm -f $conf_file`; } else { `mv -f $conf_file $conf_file.XCATORIG`; } + `echo "\# xCAT settings" > $conf_file`; `echo "*.* \@$master" > $conf_file`; } }