@@ -987,12 +987,11 @@ def do_start(self, args):
987
987
988
988
def do_restart (self , args ):
989
989
"""
990
- Restart services or agents or database server
990
+ Restart components ( services, agents, executors)
991
991
992
992
usage:
993
993
994
994
restart <system|*> <service|agent|*>
995
- restart mysql
996
995
"""
997
996
if not args :
998
997
gLogger .notice (self .do_restart .__doc__ )
@@ -1001,32 +1000,29 @@ def do_restart(self, args):
1001
1000
argss = args .split ()
1002
1001
option = argss [0 ]
1003
1002
del argss [0 ]
1004
- if option != "mysql" :
1005
- if option != "*" :
1006
- if len (argss ) < 1 :
1007
- gLogger .notice (self .do_restart .__doc__ )
1008
- return
1009
- system = option
1010
- if system != "*" :
1011
- component = argss [0 ]
1012
- else :
1013
- component = "*"
1014
- client = SystemAdministratorClient (self .host , self .port )
1015
- result = client .restartComponent (system , component )
1016
- if not result ["OK" ]:
1017
- if system == "*" :
1018
- gLogger .notice ("All systems are restarted, connection to SystemAdministrator is lost" )
1019
- else :
1020
- self ._errMsg (result ["Message" ])
1003
+ if option != "*" :
1004
+ if len (argss ) < 1 :
1005
+ gLogger .notice (self .do_restart .__doc__ )
1006
+ return
1007
+ system = option
1008
+ if system != "*" :
1009
+ component = argss [0 ]
1010
+ else :
1011
+ component = "*"
1012
+ client = SystemAdministratorClient (self .host , self .port )
1013
+ result = client .restartComponent (system , component )
1014
+ if not result ["OK" ]:
1015
+ if system == "*" :
1016
+ gLogger .notice ("All systems are restarted, connection to SystemAdministrator is lost" )
1021
1017
else :
1022
- if system != "*" and component != "*" :
1023
- gLogger .notice ("\n %s_%s started successfully, runit status:\n " % (system , component ))
1024
- else :
1025
- gLogger .notice ("\n Components started successfully, runit status:\n " )
1026
- for comp in result ["Value" ]:
1027
- gLogger .notice ((comp .rjust (32 ), ":" , result ["Value" ][comp ]["RunitStatus" ]))
1018
+ self ._errMsg (result ["Message" ])
1028
1019
else :
1029
- gLogger .notice ("Not yet implemented" )
1020
+ if system != "*" and component != "*" :
1021
+ gLogger .notice ("\n %s_%s started successfully, runit status:\n " % (system , component ))
1022
+ else :
1023
+ gLogger .notice ("\n Components started successfully, runit status:\n " )
1024
+ for comp in result ["Value" ]:
1025
+ gLogger .notice ((comp .rjust (32 ), ":" , result ["Value" ][comp ]["RunitStatus" ]))
1030
1026
1031
1027
def do_stop (self , args ):
1032
1028
"""
0 commit comments