[Buildroot] [git commit branch/next] postgresql: init script: wait till server has started

From: Thomas Petazzoni <hidden>
Date: 2015-08-08 10:56:36
Subsystem: the rest · Maintainer: Linus Torvalds

commit: http://git.buildroot.net/buildroot/commit/?id=e7d515d00e5d36e1260da3768178d2364db1ef90
branch: http://git.buildroot.net/buildroot/commit/?id=refs/heads/next

Adds "-w" option to init script to wait till the database server
has fully started and accepts connections before continuing.

Prevents other applications that depend on PostgreSQL from
failing to start, if the database server is not ready yet.
Times out after 60 seconds by default.

Signed-off-by: Floris Bos <redacted>
Reviewed-by: "Yann E. MORIN" <redacted>
Signed-off-by: Thomas Petazzoni <redacted>
---
 package/postgresql/S50postgresql |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/package/postgresql/S50postgresql b/package/postgresql/S50postgresql
index 86a8d83..a895bcf 100644
--- a/package/postgresql/S50postgresql
+++ b/package/postgresql/S50postgresql
@@ -13,7 +13,7 @@ fi
 
 start() {
 	echo -n "Starting postgresql: "
-	su - postgres -c '/usr/bin/pg_ctl start -D /var/lib/pgsql -l logfile'
+	su - postgres -c '/usr/bin/pg_ctl start -w -D /var/lib/pgsql -l logfile'
 	echo "OK"
 }
 stop() {
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help