aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rumba/prototypes/ouroboros.py14
-rw-r--r--rumba/storyboard.py7
2 files changed, 11 insertions, 10 deletions
diff --git a/rumba/prototypes/ouroboros.py b/rumba/prototypes/ouroboros.py
index 1c24a0c..022c931 100644
--- a/rumba/prototypes/ouroboros.py
+++ b/rumba/prototypes/ouroboros.py
@@ -56,25 +56,25 @@ class OurServer(sb.Server):
server.difs
)
- def _make_run_cmd(self):
- o_cmd = super(OurServer, self)._make_run_cmd()
+ def _make_run_cmd(self, node):
+ o_cmd = super(OurServer, self)._make_run_cmd(node)
# Run and store PID
- n_cmd = 'pid=$(%s); ' % (o_cmd,)
+ n_cmd = 'pid=$(%s) && ' % (o_cmd,)
# Build register command
r_cmd = 'irm r n %s ' % (self.id,)
if len(self.difs) == 0:
- r_cmd += 'layer \'*\''
+ r_cmd += ' '.join('layer %s' % (layer.name,) for layer in node.difs)
else:
- r_cmd += ' '.join('layer %s' % (layer,) for layer in self.difs)
- r_cmd += ' > /dev/null 2>&1; '
+ r_cmd += ' '.join('layer %s' % (layer.name,) for layer in self.difs)
+ r_cmd += ' && '
# Add register command
n_cmd += r_cmd
# Add bind command
- n_cmd += 'irm b process $pid name %s > /dev/null 2>&1; ' % (self.id,)
+ n_cmd += 'irm b process $pid name %s && ' % (self.id,)
n_cmd += 'echo $pid' # We need to return the pid for the sb
diff --git a/rumba/storyboard.py b/rumba/storyboard.py
index ecd639d..f03a2e8 100644
--- a/rumba/storyboard.py
+++ b/rumba/storyboard.py
@@ -486,7 +486,7 @@ class Server(_SBEntity):
proc_id=p
)
- def _make_run_cmd(self):
+ def _make_run_cmd(self, node):
run_cmd = self.ap + (
(" " + self.options) if self.options is not None else ""
)
@@ -496,7 +496,7 @@ class Server(_SBEntity):
"""Starts this server"""
for node in self.nodes:
- cmd = self._make_run_cmd()
+ cmd = self._make_run_cmd(node)
logger.debug(
'Starting server %s on node %s.',
@@ -1000,7 +1000,8 @@ class StoryBoard(_SBEntity):
for node in self.node_map.values():
_execute_command(
node,
- "echo '%s' > startup.sh && chmod a+x startup.sh" % (script,)
+ "echo '#!/usr/bin/env bash' > startup.sh; "
+ "echo '%s' >> startup.sh && chmod a+x startup.sh" % (script,)
)
try:
for server in self.server_apps.values():