aboutsummaryrefslogtreecommitdiff
path: root/rumba/storyboard.py
diff options
context:
space:
mode:
authorMarco Capitani <m.capitani@nextworks.it>2018-03-27 12:54:11 +0200
committerSander Vrijders <sander.vrijders@ugent.be>2018-03-27 15:24:51 +0200
commit485ab3a152d36a5209fe01f6868472f07b25c99c (patch)
treec84a31c34eacb3f8e1c5071dc90ebd876d48ed65 /rumba/storyboard.py
parentd8747a7b810421d4a1c5aa88e85012558890e577 (diff)
downloadrumba-485ab3a152d36a5209fe01f6868472f07b25c99c.tar.gz
rumba-485ab3a152d36a5209fe01f6868472f07b25c99c.zip
storyboard: install startup.sh in all nodes
Before storyboard installed the startup only on the client nodes (i.e. nodes marked in a Client class). Now Clients could be run outside of their nodes, hence the patch. Also, incidentally, fixes an issue with server log-files.
Diffstat (limited to 'rumba/storyboard.py')
-rw-r--r--rumba/storyboard.py19
1 files changed, 6 insertions, 13 deletions
diff --git a/rumba/storyboard.py b/rumba/storyboard.py
index 61dd8cc..1d6858e 100644
--- a/rumba/storyboard.py
+++ b/rumba/storyboard.py
@@ -275,21 +275,16 @@ class Server(SBEntity):
def run(self):
for node in self.nodes:
- logfile = "/tmp/%s_server.log" % self.ap
- script = r'nohup "$@" > %s 2>&1 & echo "$!"' % (logfile,)
run_cmd = self.ap + (
(" " + self.options) if self.options is not None else ""
)
- cmd_1 = "echo '%s' > startup.sh && chmod a+x startup.sh" \
- % (script,)
- cmd_2 = "./startup.sh %s" % (run_cmd,)
+ cmd_2 = "./startup.sh %s %s" % ('server_' + self.id, run_cmd)
logger.debug(
- 'Starting server %s on node %s with logfile %s.',
- self.id, node.name, logfile
+ 'Starting server %s on node %s.',
+ self.id, node.name
)
try:
- node.execute_command(cmd_1)
- self.pids[node] = (node.execute_command(cmd_2))
+ self.pids[node] = node.execute_command(cmd_2)
except ssh_support.SSHException:
logger.warn('Could not start server %s on node %s.',
self.id, node.name)
@@ -664,8 +659,6 @@ class StoryBoard(SBEntity):
self._build_nodes_lists()
logger.debug('Server nodes are: %s.',
[x.name for x in self.server_nodes])
- logger.debug('Client nodes are: %s.',
- [x.name for x in self.client_nodes])
logger.debug('Command list is: %s.', {x: [(y.name, z)
for y, z in t]
for (x, t)
@@ -673,8 +666,8 @@ class StoryBoard(SBEntity):
self.start_time = time.time()
script = r'logname="$1"; shift; nohup "${@}" ' \
r'> /tmp/${logname}.rumba.log 2>&1 & echo "$!"'
- logger.debug("Writing utility startup script on client nodes.")
- for node in self.client_nodes:
+ logger.debug("Writing utility startup script on nodes.")
+ for node in self.node_map.values():
node.execute_command(
"echo '%s' > startup.sh && chmod a+x startup.sh" % (script,)
)