mirror of
				https://github.com/xcat2/xcat-core.git
				synced 2025-10-31 03:12:30 +00:00 
			
		
		
		
	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
This commit is contained in:
		| @@ -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); | ||||
|     } | ||||
|   | ||||
| @@ -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 | ||||
|   | ||||
| @@ -75,7 +75,7 @@ restart) | ||||
|   ;; | ||||
| reload) | ||||
|   $0 stop | ||||
|   echo -n "Reloading xCATd " | ||||
|   echo -n "(Reloading) " | ||||
|   export XCATRELOAD=yes  | ||||
|   $0 start | ||||
|   ;; | ||||
|   | ||||
| @@ -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 | ||||
|         } | ||||
|     } | ||||
|   | ||||
| @@ -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; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user