Project

General

Profile

« Previous | Next » 

Revision 6201

root Makefile: PostgreSQL: $(pg_ctl-*): Fixed bug where need to pause for a few seconds after restarting PostgreSQL, to wait for the server to be ready to accept connections

View differences:

Makefile
143 143
pgVersion = "$$(env minor=1 bin/pg_version)"
144 144

  
145 145
linuxPostgresDir := /etc/postgresql/9.1/main
146
pg_ctl-Linux := $(asAdmin) /etc/init.d/postgresql
146
define pg_ctl-Linux
147
$(asAdmin) /etc/init.d/postgresql $(1)
148
sleep 2
149
endef
147 150

  
148 151
postgres-Linux: _always
149 152
	-sudo apt-get install postgresql
......
157 160
	-sudo apache2ctl restart
158 161
	-sudo pip install psycopg2
159 162
	$(asAdmin) cp --preserve=timestamps schemas/postgresql.conf $(linuxPostgresDir)/postgresql.conf
160
	$(pg_ctl-Linux) restart
163
	$(call pg_ctl-Linux,restart)
161 164
# run pg_version inline because it needs postgresql to be installed first
162 165
# ignore errors if conf files already edited
163 166

  
......
173 176
macPostgresLibs := $(macPostgresLibs) $(macPostgresLibs:%=%.1.0.0)
174 177
macPostgresLibs := $(macPostgresLibs:%=%.dylib)
175 178

  
176
pg_ctl-Darwin := $(asAdmin) pg_ctl -D $(macPostgresDir)/data\
177
-l $(macPostgresDir)/postgres.log
179
define pg_ctl-Darwin
180
$(asAdmin) pg_ctl -D $(macPostgresDir)/data -l $(macPostgresDir)/postgres.log $(1)
181
sleep 2
182
endef
178 183

  
179 184
postgres-Darwin: _always
180 185
	@echo $(emph)'Installing PostgreSQL on Mac OS X:'$(endEmph)
......
184 189
	@$(wait)
185 190
	$(foreach lib,$(macPostgresLibs),$(call macUsePostgresLib,$(lib)))
186 191
	$(asAdmin) cp schemas/postgresql.Mac.conf $(macPostgresDir)/data/postgresql.conf
187
	$(pg_ctl-Darwin) restart
192
	$(call pg_ctl-Darwin,restart)
188 193

  
189 194
postgres-: _always ; # other OSes
190 195

  

Also available in: Unified diff