From 1828e745c6581b1307fe43c49aee6e26fc80c71a Mon Sep 17 00:00:00 2001 From: lissav Date: Tue, 11 Mar 2008 19:02:18 +0000 Subject: [PATCH] Add to start rsyslog for Fedora. git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@761 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server-2.0/lib/xcat/plugins/SYSLOGsn.pm | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/xCAT-server-2.0/lib/xcat/plugins/SYSLOGsn.pm b/xCAT-server-2.0/lib/xcat/plugins/SYSLOGsn.pm index 56483d190..249a14d90 100644 --- a/xCAT-server-2.0/lib/xcat/plugins/SYSLOGsn.pm +++ b/xCAT-server-2.0/lib/xcat/plugins/SYSLOGsn.pm @@ -70,15 +70,28 @@ sub process_request sub setup_SYSLOG { my $rc = 0; + my $cmd; if (-e "/etc/syslog.conf") { - my $cmd = "grep *.debug /etc/syslog.conf"; + $cmd = "grep *.debug /etc/syslog.conf"; xCAT::Utils->runcmd($cmd, -1); if ($::RUNCMD_RC != 0) { # need to add ` echo "*.debug /var/log/messages" >> /etc/syslog.conf`; `echo "*.crit /var/log/messages" >> /etc/syslog.conf`; - `service syslog restart`; + $cmd = "service syslog restart"; + xCAT::Utils->runcmd($cmd, -1); + if ($::RUNCMD_RC != 0) + { # error try rsyslog + $cmd = "service rsyslog restart"; + xCAT::Utils->runcmd($cmd, -1); + if ($::RUNCMD_RC != 0) + { # error on both + xCAT::MsgUtils->message("S", + "Error could not start syslog or rsyslog"); + return 1; + } + } } }