From d17ea4a3f5b1ab2474d399f96aad3e11eee11542 Mon Sep 17 00:00:00 2001 From: bp-sawyers Date: Wed, 23 Sep 2009 14:09:12 +0000 Subject: [PATCH] Cleaned up the output of the service start/stop on linux (because I'm OCD) git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@4210 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- perl-xCAT/xCAT/ExtTab.pm | 2 +- perl-xCAT/xCAT/Utils.pm | 8 ++++++++ xCAT-server/etc/init.d/xcatd | 2 +- xCAT-server/lib/xcat/plugins/AAsn.pm | 1 + xCAT-server/sbin/xcatd | 8 +++++--- 5 files changed, 16 insertions(+), 5 deletions(-) diff --git a/perl-xCAT/xCAT/ExtTab.pm b/perl-xCAT/xCAT/ExtTab.pm index 1aa8edf57..b4b39f136 100644 --- a/perl-xCAT/xCAT/ExtTab.pm +++ b/perl-xCAT/xCAT/ExtTab.pm @@ -109,7 +109,7 @@ foreach (@extSchema) { sub updateTables { #print "\nupdateTables\n"; - print "\n"; + #print "\n"; foreach (keys %ext_tabspec) { my $table= xCAT::Table->new($_,-create=>1,-autocommit=>1); } diff --git a/perl-xCAT/xCAT/Utils.pm b/perl-xCAT/xCAT/Utils.pm index 7a1343968..967bce17d 100644 --- a/perl-xCAT/xCAT/Utils.pm +++ b/perl-xCAT/xCAT/Utils.pm @@ -3978,12 +3978,14 @@ sub startService if (($service ne "conserver") && ($service ne "nfs")) { $cmd = "service $service stop"; + print ' '; # indent service output to separate it from the xcatd service output system $cmd; if ($? > 0) { # error xCAT::MsgUtils->message("S", "Error on command: $cmd\n"); } $cmd = "service $service start"; + print ' '; # indent service output to separate it from the xcatd service output system $cmd; if ($? > 0) { # error @@ -3999,6 +4001,7 @@ sub startService if (grep(/running/, @output)) { $cmd = "service $service stop"; + print ' '; # indent service output to separate it from the xcatd service output system $cmd; if ($? > 0) { # error @@ -4006,6 +4009,7 @@ sub startService "Error on command: $cmd\n"); } $cmd = "service $service start"; + print ' '; # indent service output to separate it from the xcatd service output system $cmd; if ($? > 0) { # error @@ -4020,6 +4024,7 @@ sub startService # not running , just start $cmd = "service $service start"; + print ' '; # indent service output to separate it from the xcatd service output system $cmd; if ($? > 0) { # error @@ -4039,6 +4044,7 @@ sub startService if (grep(/stopped/, @output)) # stopped { $cmd = "service $service start"; + print ' '; # indent service output to separate it from the xcatd service output system $cmd; if ($? > 0) { # error @@ -4049,12 +4055,14 @@ sub startService else { # not sure $cmd = "service $service stop"; + print ' '; # indent service output to separate it from the xcatd service output system $cmd; if ($? > 0) { # error xCAT::MsgUtils->message("S", "Error on command: $cmd\n"); } $cmd = "service $service start"; + print ' '; # indent service output to separate it from the xcatd service output system $cmd; if ($? > 0) { # error diff --git a/xCAT-server/etc/init.d/xcatd b/xCAT-server/etc/init.d/xcatd index 47bd974c2..215297faf 100755 --- a/xCAT-server/etc/init.d/xcatd +++ b/xCAT-server/etc/init.d/xcatd @@ -75,7 +75,7 @@ restart) ;; reload) $0 stop - echo -n "Reloading xCATd " + echo -n "(Reloading) " export XCATRELOAD=yes $0 start ;; diff --git a/xCAT-server/lib/xcat/plugins/AAsn.pm b/xCAT-server/lib/xcat/plugins/AAsn.pm index 7f302fe61..5486a6c07 100644 --- a/xCAT-server/lib/xcat/plugins/AAsn.pm +++ b/xCAT-server/lib/xcat/plugins/AAsn.pm @@ -249,6 +249,7 @@ sub init_plugin # $rc = &setup_NTPmn(); # setup NTP on the Management Node if (xCAT::Utils->isLinux()) { + print "\n"; # make OK prints look better. Only need to do this for the 1st service. $rc = &setup_FTP(); # setup FTP } } diff --git a/xCAT-server/sbin/xcatd b/xCAT-server/sbin/xcatd index 0b68923da..b60fd41d5 100755 --- a/xCAT-server/sbin/xcatd +++ b/xCAT-server/sbin/xcatd @@ -458,9 +458,11 @@ sub scan_plugins { } } scan_plugins; -eval { - xCAT::MsgUtils->message("S","xCATd: service starting"); -}; +unless (xCAT::Utils->isLinux()) { # messes up the output of the service cmd on linux + eval { + xCAT::MsgUtils->message("S","xCATd: service starting"); + }; +} if ($@) { print "ERROR: $@"; xexit;