Skip to content

Commit

Permalink
fix(BaseNode): change dir for startup script from /tmp to $HOME
Browse files Browse the repository at this point in the history
Fix changes directory for startup script upload from /tmp to $HOME.
The change is required for DB nodes deployed in Cloud where /tmp dir
is mounted with noexec option what makes script execution impossible
there.

As per discussion (#1), for DB nodes deployed in SCT startup_script
can be executed either from $HOME or /tmp.

refs:
#1: #9608
  • Loading branch information
mikliapko authored and fruch committed Dec 24, 2024
1 parent e80f2bf commit 2940923
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sdcm/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -2911,7 +2911,8 @@ def run_cqlsh(self, cmd, keyspace=None, timeout=120, verbose=True, split=False,
return cqlsh_out if not split else list(map(str.strip, cqlsh_out.stdout.splitlines()))

def run_startup_script(self):
startup_script_remote_path = '/tmp/sct-startup.sh'
remote_home_dir = self.remoter.run("echo $HOME").stdout.strip()
startup_script_remote_path = f"{remote_home_dir}/startup_script.sh"

with tempfile.NamedTemporaryFile(mode='w+', delete=False, encoding='utf-8') as tmp_file:
tmp_file.write(self.test_config.get_startup_script())
Expand Down

0 comments on commit 2940923

Please sign in to comment.