|
13 | 13 | */ |
14 | 14 | package io.zonky.test.db.postgres.embedded; |
15 | 15 |
|
| 16 | +import io.zonky.test.db.postgres.util.LinuxUtils; |
| 17 | +import org.apache.commons.codec.binary.Hex; |
| 18 | +import org.apache.commons.compress.archivers.tar.TarArchiveEntry; |
| 19 | +import org.apache.commons.compress.archivers.tar.TarArchiveInputStream; |
| 20 | +import org.apache.commons.io.FileUtils; |
| 21 | +import org.apache.commons.io.IOUtils; |
| 22 | +import org.apache.commons.io.output.ByteArrayOutputStream; |
| 23 | +import org.apache.commons.lang3.SystemUtils; |
| 24 | +import org.apache.commons.lang3.time.StopWatch; |
| 25 | +import org.postgresql.ds.PGSimpleDataSource; |
| 26 | +import org.slf4j.Logger; |
| 27 | +import org.slf4j.LoggerFactory; |
| 28 | +import org.tukaani.xz.XZInputStream; |
| 29 | + |
| 30 | +import javax.sql.DataSource; |
16 | 31 | import java.io.ByteArrayInputStream; |
17 | 32 | import java.io.Closeable; |
18 | 33 | import java.io.File; |
|
58 | 73 | import java.util.concurrent.locks.ReentrantLock; |
59 | 74 | import java.util.stream.Stream; |
60 | 75 |
|
61 | | -import javax.sql.DataSource; |
62 | | - |
63 | | -import org.apache.commons.codec.binary.Hex; |
64 | | -import org.apache.commons.compress.archivers.tar.TarArchiveEntry; |
65 | | -import org.apache.commons.compress.archivers.tar.TarArchiveInputStream; |
66 | | -import org.apache.commons.io.FileUtils; |
67 | | -import org.apache.commons.io.IOUtils; |
68 | | -import org.apache.commons.io.output.ByteArrayOutputStream; |
69 | | -import org.apache.commons.lang3.SystemUtils; |
70 | | -import org.apache.commons.lang3.time.StopWatch; |
71 | | -import org.postgresql.ds.PGSimpleDataSource; |
72 | | -import org.slf4j.Logger; |
73 | | -import org.slf4j.LoggerFactory; |
74 | | -import org.tukaani.xz.XZInputStream; |
75 | | - |
76 | | -import io.zonky.test.db.postgres.util.LinuxUtils; |
77 | | - |
78 | 76 | import static java.nio.file.StandardOpenOption.CREATE; |
79 | 77 | import static java.nio.file.StandardOpenOption.WRITE; |
80 | 78 | import static java.util.Collections.unmodifiableMap; |
@@ -262,11 +260,14 @@ private void startPostmaster() throws IOException |
262 | 260 | } |
263 | 261 |
|
264 | 262 | final List<String> args = new ArrayList<>(); |
265 | | - args.addAll(Arrays.asList("-D", dataDirectory.getPath())); |
266 | | - args.addAll(createInitOptions()); |
| 263 | + args.addAll(Arrays.asList( |
| 264 | + "-D", dataDirectory.getPath(), |
| 265 | + "-o", String.join(" ", createInitOptions()), |
| 266 | + "-w", "start" |
| 267 | + )); |
267 | 268 |
|
268 | 269 | final ProcessBuilder builder = new ProcessBuilder(); |
269 | | - POSTGRES.applyTo(builder, args); |
| 270 | + PG_CTL.applyTo(builder, args); |
270 | 271 |
|
271 | 272 | builder.redirectErrorStream(true); |
272 | 273 | builder.redirectError(errorRedirector); |
|
0 commit comments