Capture initdb's stdout/stderr, to avoid messing with log formatting.

Especially with --interactive.
This commit is contained in:
Heikki Linnakangas
2021-04-07 18:51:34 +03:00
parent abaa36a15c
commit 198fc9ea53

View File

@@ -155,12 +155,14 @@ impl WalRedoProcess {
Command::new("initdb")
.args(&["-D", datadir.to_str().unwrap()])
.arg("-N")
.status(),
.output(),
)
.expect("failed to execute initdb");
if !initdb.success() {
panic!("initdb failed");
if !initdb.status.success() {
panic!("initdb failed: {}\nstderr:\n{}",
std::str::from_utf8(&initdb.stdout).unwrap(),
std::str::from_utf8(&initdb.stderr).unwrap());
}
// Start postgres itself