-Change MsgUtils function to not fork logger

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@2015 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jbjohnso 2008-08-12 17:21:08 +00:00
parent aa07dbc4e5
commit 9c0da486aa

View File

@ -4,7 +4,7 @@
package xCAT::MsgUtils;
use strict;
use Sys::Syslog;
use Sys::Syslog qw (:DEFAULT setlogsock);
#use locale;
use Socket;
use File::Path;
@ -280,16 +280,15 @@ sub message
# If they want this msg to also go to syslog, do that now
eval {
#openlog("xCAT", '', 'local4');
#syslog("err", $rsp);
#closelog();
# switched to logger due to hangs using Perl interface
# when syslog not running
`logger -p local4.err -t xcat $rsp`;
if ( $? != 0) {
print $stdouterrf "Error using Syslog\n";
}
openlog("xCAT", '', 'local4');
setlogsock(["tcp","unix","stream"]);
syslog("err", $rsp);
closelog();
};
my $errstr = $@;
if ($errstr) {
print $stdouterrf "Unable to log $rsp to syslog because of $errstr\n";
}
}
}
return;