From b746e30cd2c4211b254338d3df670a62f76dd66a Mon Sep 17 00:00:00 2001 From: Muhammad Asif Naeem Date: Tue, 17 Jun 2025 11:15:42 +0500 Subject: [PATCH] It is observed that installation on AWS fail with slow disk via CLI. It seems to be a bug that caused the issue. Replacing `subprocess.Popen` with `subprocess.run` as it is asynchronous in nature and do not wait for the process to finish. Also added more timeout value for `pg_ctl` command as it's default wait time is 60 seconds only (Jira CUS-30) --- src/pgXX/run-pgctl.py | 3 ++- src/pgXX/start-pgXX.py | 3 +-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pgXX/run-pgctl.py b/src/pgXX/run-pgctl.py index 266548ec..ace5ef83 100644 --- a/src/pgXX/run-pgctl.py +++ b/src/pgXX/run-pgctl.py @@ -28,5 +28,6 @@ util.read_env_file(pgver) -cmd = pg_ctl + ' start -s -w -D "' + datadir + '" ' + '-l "' + logfile + '"' +# Wait enough before exit +cmd = pg_ctl + ' start -s -w -t 600 -D "' + datadir + '" ' + '-l "' + logfile + '"' util.system(cmd) diff --git a/src/pgXX/start-pgXX.py b/src/pgXX/start-pgXX.py index 8f0b53bc..e722bbc3 100644 --- a/src/pgXX/start-pgXX.py +++ b/src/pgXX/start-pgXX.py @@ -37,8 +37,7 @@ if autostart == "on": startup.start_linux("pg" + pgver[2:4]) else: - startCmd = cmd + " &" - subprocess.Popen(startCmd, preexec_fn=os.setpgrp(), close_fds=True, shell=True) + subprocess.run(cmd, preexec_fn=os.setpgrp(), close_fds=True, shell=True) isYes = os.getenv("isYes", "False") pgName = os.getenv("pgName", "")