Skip to content

Commit 5b351c4

Browse files
committed
fix: restart mysql is not (was never) allowed from systemAdministrator
1 parent 6977aaa commit 5b351c4

File tree

2 files changed

+23
-28
lines changed

2 files changed

+23
-28
lines changed

docs/source/AdministratorGuide/HowTo/SystemAdministratorInterface.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -223,10 +223,9 @@ For example, start a service::
223223

224224
WorkloadManagement_PilotManager : Run
225225

226-
Restart services or agents or database server::
226+
Restart services or agents::
227227

228228
restart <system|*> <service|agent|*>
229-
restart mysql
230229

231230
Restarting all the services and agents::
232231

src/DIRAC/FrameworkSystem/Client/SystemAdministratorClientCLI.py

Lines changed: 22 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -987,12 +987,11 @@ def do_start(self, args):
987987

988988
def do_restart(self, args):
989989
"""
990-
Restart services or agents or database server
990+
Restart components (services, agents, executors)
991991
992992
usage:
993993
994994
restart <system|*> <service|agent|*>
995-
restart mysql
996995
"""
997996
if not args:
998997
gLogger.notice(self.do_restart.__doc__)
@@ -1001,32 +1000,29 @@ def do_restart(self, args):
10011000
argss = args.split()
10021001
option = argss[0]
10031002
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")
10211017
else:
1022-
if system != "*" and component != "*":
1023-
gLogger.notice("\n%s_%s started successfully, runit status:\n" % (system, component))
1024-
else:
1025-
gLogger.notice("\nComponents 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"])
10281019
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("\nComponents started successfully, runit status:\n")
1024+
for comp in result["Value"]:
1025+
gLogger.notice((comp.rjust(32), ":", result["Value"][comp]["RunitStatus"]))
10301026

10311027
def do_stop(self, args):
10321028
"""

0 commit comments

Comments
 (0)