From b3a60ee7615b430c00e62c2105916c7d74417dbc Mon Sep 17 00:00:00 2001 From: Neha Deodhar Date: Wed, 27 Mar 2019 17:00:21 -0700 Subject: [PATCH] [yb-docker-ctl] Save initdb log (#1087) * Save initdb log for yb-docker-ctl --- bin/yb-docker-ctl | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bin/yb-docker-ctl b/bin/yb-docker-ctl index 6a8b9e1268c2..4c8844da04dd 100755 --- a/bin/yb-docker-ctl +++ b/bin/yb-docker-ctl @@ -418,11 +418,15 @@ class YBDockerControl(): init_db_cmd = "{} {}/initdb -U postgres -D {}".format( init_db_envs, pg_bin_dir, tmp_data_dir) # Setup the list based cmdline. - print("Running initdb to initialize PostgreSQL metadata " - "in the YugaByte cluster. This may take up to a minute.") docker_cmd = ['docker', 'exec', '-it', self.YB_TSERVER_FORMAT.format(1)] docker_cmd.extend(["bash", "-c", init_db_cmd]) + print(' '.join(docker_cmd)) + print("Running initdb to initialize YSQL metadata " + "in the YugaByte cluster. This may take up to a minute.") result = get_subprocess_result_as_str(docker_cmd) + with open("initdb.log", "w") as initdb_log: + initdb_log.write(result) + print("initdb log available at ./initdb.log") return except subprocess.CalledProcessError: pass