From b494135c58184fd92397768a2f39d56e19e947ed Mon Sep 17 00:00:00 2001 From: Simon Li Date: Thu, 5 Dec 2013 14:54:45 +0000 Subject: [PATCH 1/5] Remove duplicate postgres startup --- docs/hudson/OMERO-homebrew-install.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/hudson/OMERO-homebrew-install.sh b/docs/hudson/OMERO-homebrew-install.sh index 3e71513bb12..60c50cefc70 100755 --- a/docs/hudson/OMERO-homebrew-install.sh +++ b/docs/hudson/OMERO-homebrew-install.sh @@ -109,7 +109,6 @@ if [ -d "$PSQL_DIR" ]; then fi bin/initdb $PSQL_DIR bin/brew services restart postgresql -bin/pg_ctl -D $PSQL_DIR -l $PSQL_DIR/server.log start # Create user and database bin/createuser -w -D -R -S db_user From 467c6cd73ef7634080ee5d57c9f364f152bbdaa6 Mon Sep 17 00:00:00 2001 From: Simon Li Date: Thu, 5 Dec 2013 16:20:20 +0000 Subject: [PATCH 2/5] brew services doesn't seem to work, use pg_ctl instead --- docs/hudson/OMERO-homebrew-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/hudson/OMERO-homebrew-install.sh b/docs/hudson/OMERO-homebrew-install.sh index 60c50cefc70..01c8eceb7cf 100755 --- a/docs/hudson/OMERO-homebrew-install.sh +++ b/docs/hudson/OMERO-homebrew-install.sh @@ -108,7 +108,7 @@ if [ -d "$PSQL_DIR" ]; then rm -rf $PSQL_DIR fi bin/initdb $PSQL_DIR -bin/brew services restart postgresql +bin/pg_ctl -D $PSQL_DIR -l $PSQL_DIR/server.log start # Create user and database bin/createuser -w -D -R -S db_user From a6774d4aa5c7fd6344322949a285958b29ccf126 Mon Sep 17 00:00:00 2001 From: Simon Li Date: Fri, 6 Dec 2013 11:09:22 +0000 Subject: [PATCH 3/5] Pass -w to pg_ctl so that it waits for server to start --- docs/hudson/OMERO-homebrew-install.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/hudson/OMERO-homebrew-install.sh b/docs/hudson/OMERO-homebrew-install.sh index 01c8eceb7cf..c3b402b2647 100755 --- a/docs/hudson/OMERO-homebrew-install.sh +++ b/docs/hudson/OMERO-homebrew-install.sh @@ -108,7 +108,7 @@ if [ -d "$PSQL_DIR" ]; then rm -rf $PSQL_DIR fi bin/initdb $PSQL_DIR -bin/pg_ctl -D $PSQL_DIR -l $PSQL_DIR/server.log start +bin/pg_ctl -D $PSQL_DIR -l $PSQL_DIR/server.log -w start # Create user and database bin/createuser -w -D -R -S db_user From 03fe449bef678d4eee61b4369f721b12598b8472 Mon Sep 17 00:00:00 2001 From: Simon Li Date: Fri, 6 Dec 2013 13:59:22 +0000 Subject: [PATCH 4/5] killall postgres --- docs/hudson/OMERO-homebrew-install.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/hudson/OMERO-homebrew-install.sh b/docs/hudson/OMERO-homebrew-install.sh index c3b402b2647..e071294f3f7 100755 --- a/docs/hudson/OMERO-homebrew-install.sh +++ b/docs/hudson/OMERO-homebrew-install.sh @@ -103,6 +103,10 @@ export PYTHONPATH=$(bin/brew --prefix omero)/lib/python:$ICE_HOME/python export PATH=$(bin/brew --prefix)/bin:$(bin/brew --prefix)/sbin:/usr/local/lib/node_modules:$ICE_HOME/bin:$PATH export DYLD_LIBRARY_PATH=$ICE_HOME/lib:$ICE_HOME/python:${DYLD_LIBRARY_PATH-} +# There may be an old postgres process still running, but its working directory +# may have been deleted so pg_ctl won't work. +killall postgres || echo No existing postgres running + # Create PostgreSQL database if [ -d "$PSQL_DIR" ]; then rm -rf $PSQL_DIR From d8c28b7761bb0e3cde5dfa65be7c6eae022cac21 Mon Sep 17 00:00:00 2001 From: Simon Li Date: Sun, 8 Dec 2013 20:43:38 +0000 Subject: [PATCH 5/5] Remove killall postgres, put it in the jenkins config instead --- docs/hudson/OMERO-homebrew-install.sh | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/docs/hudson/OMERO-homebrew-install.sh b/docs/hudson/OMERO-homebrew-install.sh index e071294f3f7..e9ad64db9c3 100755 --- a/docs/hudson/OMERO-homebrew-install.sh +++ b/docs/hudson/OMERO-homebrew-install.sh @@ -103,10 +103,8 @@ export PYTHONPATH=$(bin/brew --prefix omero)/lib/python:$ICE_HOME/python export PATH=$(bin/brew --prefix)/bin:$(bin/brew --prefix)/sbin:/usr/local/lib/node_modules:$ICE_HOME/bin:$PATH export DYLD_LIBRARY_PATH=$ICE_HOME/lib:$ICE_HOME/python:${DYLD_LIBRARY_PATH-} -# There may be an old postgres process still running, but its working directory -# may have been deleted so pg_ctl won't work. -killall postgres || echo No existing postgres running - +# Note: If postgres startup fails it's probably because there was an old +# process still running. # Create PostgreSQL database if [ -d "$PSQL_DIR" ]; then rm -rf $PSQL_DIR