File tree Expand file tree Collapse file tree 13 files changed +234
-13
lines changed Expand file tree Collapse file tree 13 files changed +234
-13
lines changed Original file line number Diff line number Diff line change @@ -229,13 +229,30 @@ docker_temp_server_stop() {
229229 pg_ctl -D " $PGDATA " -m fast -w stop
230230}
231231
232+ # check arguments for an option that would cause postgres to stop
233+ # return true if there is one
234+ _pg_want_help () {
235+ local arg
236+ for arg; do
237+ case " $arg " in
238+ # postgres --help | grep 'then exit'
239+ # leaving out -C on purpose since it always fails and is unhelpful:
240+ # postgres: could not access the server configuration file "/var/lib/postgresql/data/postgresql.conf": No such file or directory
241+ -' ?' |--help|--describe-config|-V|--version)
242+ return 0
243+ ;;
244+ esac
245+ done
246+ return 1
247+ }
248+
232249_main () {
233250 # if first arg looks like a flag, assume we want to run postgres server
234251 if [ " ${1: 0: 1} " = ' -' ]; then
235252 set -- postgres " $@ "
236253 fi
237254
238- if [ " $1 " = ' postgres' ]; then
255+ if [ " $1 " = ' postgres' ] && ! _pg_want_help " $@ " ; then
239256 docker_setup_env
240257 # setup data directories and permissions (when run as root)
241258 docker_create_db_directories
Original file line number Diff line number Diff line change @@ -229,13 +229,30 @@ docker_temp_server_stop() {
229229 pg_ctl -D " $PGDATA " -m fast -w stop
230230}
231231
232+ # check arguments for an option that would cause postgres to stop
233+ # return true if there is one
234+ _pg_want_help () {
235+ local arg
236+ for arg; do
237+ case " $arg " in
238+ # postgres --help | grep 'then exit'
239+ # leaving out -C on purpose since it always fails and is unhelpful:
240+ # postgres: could not access the server configuration file "/var/lib/postgresql/data/postgresql.conf": No such file or directory
241+ -' ?' |--help|--describe-config|-V|--version)
242+ return 0
243+ ;;
244+ esac
245+ done
246+ return 1
247+ }
248+
232249_main () {
233250 # if first arg looks like a flag, assume we want to run postgres server
234251 if [ " ${1: 0: 1} " = ' -' ]; then
235252 set -- postgres " $@ "
236253 fi
237254
238- if [ " $1 " = ' postgres' ]; then
255+ if [ " $1 " = ' postgres' ] && ! _pg_want_help " $@ " ; then
239256 docker_setup_env
240257 # setup data directories and permissions (when run as root)
241258 docker_create_db_directories
Original file line number Diff line number Diff line change @@ -229,13 +229,30 @@ docker_temp_server_stop() {
229229 pg_ctl -D " $PGDATA " -m fast -w stop
230230}
231231
232+ # check arguments for an option that would cause postgres to stop
233+ # return true if there is one
234+ _pg_want_help () {
235+ local arg
236+ for arg; do
237+ case " $arg " in
238+ # postgres --help | grep 'then exit'
239+ # leaving out -C on purpose since it always fails and is unhelpful:
240+ # postgres: could not access the server configuration file "/var/lib/postgresql/data/postgresql.conf": No such file or directory
241+ -' ?' |--help|--describe-config|-V|--version)
242+ return 0
243+ ;;
244+ esac
245+ done
246+ return 1
247+ }
248+
232249_main () {
233250 # if first arg looks like a flag, assume we want to run postgres server
234251 if [ " ${1: 0: 1} " = ' -' ]; then
235252 set -- postgres " $@ "
236253 fi
237254
238- if [ " $1 " = ' postgres' ]; then
255+ if [ " $1 " = ' postgres' ] && ! _pg_want_help " $@ " ; then
239256 docker_setup_env
240257 # setup data directories and permissions (when run as root)
241258 docker_create_db_directories
Original file line number Diff line number Diff line change @@ -229,13 +229,30 @@ docker_temp_server_stop() {
229229 pg_ctl -D " $PGDATA " -m fast -w stop
230230}
231231
232+ # check arguments for an option that would cause postgres to stop
233+ # return true if there is one
234+ _pg_want_help () {
235+ local arg
236+ for arg; do
237+ case " $arg " in
238+ # postgres --help | grep 'then exit'
239+ # leaving out -C on purpose since it always fails and is unhelpful:
240+ # postgres: could not access the server configuration file "/var/lib/postgresql/data/postgresql.conf": No such file or directory
241+ -' ?' |--help|--describe-config|-V|--version)
242+ return 0
243+ ;;
244+ esac
245+ done
246+ return 1
247+ }
248+
232249_main () {
233250 # if first arg looks like a flag, assume we want to run postgres server
234251 if [ " ${1: 0: 1} " = ' -' ]; then
235252 set -- postgres " $@ "
236253 fi
237254
238- if [ " $1 " = ' postgres' ]; then
255+ if [ " $1 " = ' postgres' ] && ! _pg_want_help " $@ " ; then
239256 docker_setup_env
240257 # setup data directories and permissions (when run as root)
241258 docker_create_db_directories
Original file line number Diff line number Diff line change @@ -229,13 +229,30 @@ docker_temp_server_stop() {
229229 pg_ctl -D " $PGDATA " -m fast -w stop
230230}
231231
232+ # check arguments for an option that would cause postgres to stop
233+ # return true if there is one
234+ _pg_want_help () {
235+ local arg
236+ for arg; do
237+ case " $arg " in
238+ # postgres --help | grep 'then exit'
239+ # leaving out -C on purpose since it always fails and is unhelpful:
240+ # postgres: could not access the server configuration file "/var/lib/postgresql/data/postgresql.conf": No such file or directory
241+ -' ?' |--help|--describe-config|-V|--version)
242+ return 0
243+ ;;
244+ esac
245+ done
246+ return 1
247+ }
248+
232249_main () {
233250 # if first arg looks like a flag, assume we want to run postgres server
234251 if [ " ${1: 0: 1} " = ' -' ]; then
235252 set -- postgres " $@ "
236253 fi
237254
238- if [ " $1 " = ' postgres' ]; then
255+ if [ " $1 " = ' postgres' ] && ! _pg_want_help " $@ " ; then
239256 docker_setup_env
240257 # setup data directories and permissions (when run as root)
241258 docker_create_db_directories
Original file line number Diff line number Diff line change @@ -229,13 +229,30 @@ docker_temp_server_stop() {
229229 pg_ctl -D " $PGDATA " -m fast -w stop
230230}
231231
232+ # check arguments for an option that would cause postgres to stop
233+ # return true if there is one
234+ _pg_want_help () {
235+ local arg
236+ for arg; do
237+ case " $arg " in
238+ # postgres --help | grep 'then exit'
239+ # leaving out -C on purpose since it always fails and is unhelpful:
240+ # postgres: could not access the server configuration file "/var/lib/postgresql/data/postgresql.conf": No such file or directory
241+ -' ?' |--help|--describe-config|-V|--version)
242+ return 0
243+ ;;
244+ esac
245+ done
246+ return 1
247+ }
248+
232249_main () {
233250 # if first arg looks like a flag, assume we want to run postgres server
234251 if [ " ${1: 0: 1} " = ' -' ]; then
235252 set -- postgres " $@ "
236253 fi
237254
238- if [ " $1 " = ' postgres' ]; then
255+ if [ " $1 " = ' postgres' ] && ! _pg_want_help " $@ " ; then
239256 docker_setup_env
240257 # setup data directories and permissions (when run as root)
241258 docker_create_db_directories
Original file line number Diff line number Diff line change @@ -229,13 +229,30 @@ docker_temp_server_stop() {
229229 pg_ctl -D " $PGDATA " -m fast -w stop
230230}
231231
232+ # check arguments for an option that would cause postgres to stop
233+ # return true if there is one
234+ _pg_want_help () {
235+ local arg
236+ for arg; do
237+ case " $arg " in
238+ # postgres --help | grep 'then exit'
239+ # leaving out -C on purpose since it always fails and is unhelpful:
240+ # postgres: could not access the server configuration file "/var/lib/postgresql/data/postgresql.conf": No such file or directory
241+ -' ?' |--help|--describe-config|-V|--version)
242+ return 0
243+ ;;
244+ esac
245+ done
246+ return 1
247+ }
248+
232249_main () {
233250 # if first arg looks like a flag, assume we want to run postgres server
234251 if [ " ${1: 0: 1} " = ' -' ]; then
235252 set -- postgres " $@ "
236253 fi
237254
238- if [ " $1 " = ' postgres' ]; then
255+ if [ " $1 " = ' postgres' ] && ! _pg_want_help " $@ " ; then
239256 docker_setup_env
240257 # setup data directories and permissions (when run as root)
241258 docker_create_db_directories
Original file line number Diff line number Diff line change @@ -229,13 +229,30 @@ docker_temp_server_stop() {
229229 pg_ctl -D " $PGDATA " -m fast -w stop
230230}
231231
232+ # check arguments for an option that would cause postgres to stop
233+ # return true if there is one
234+ _pg_want_help () {
235+ local arg
236+ for arg; do
237+ case " $arg " in
238+ # postgres --help | grep 'then exit'
239+ # leaving out -C on purpose since it always fails and is unhelpful:
240+ # postgres: could not access the server configuration file "/var/lib/postgresql/data/postgresql.conf": No such file or directory
241+ -' ?' |--help|--describe-config|-V|--version)
242+ return 0
243+ ;;
244+ esac
245+ done
246+ return 1
247+ }
248+
232249_main () {
233250 # if first arg looks like a flag, assume we want to run postgres server
234251 if [ " ${1: 0: 1} " = ' -' ]; then
235252 set -- postgres " $@ "
236253 fi
237254
238- if [ " $1 " = ' postgres' ]; then
255+ if [ " $1 " = ' postgres' ] && ! _pg_want_help " $@ " ; then
239256 docker_setup_env
240257 # setup data directories and permissions (when run as root)
241258 docker_create_db_directories
Original file line number Diff line number Diff line change @@ -229,13 +229,30 @@ docker_temp_server_stop() {
229229 pg_ctl -D " $PGDATA " -m fast -w stop
230230}
231231
232+ # check arguments for an option that would cause postgres to stop
233+ # return true if there is one
234+ _pg_want_help () {
235+ local arg
236+ for arg; do
237+ case " $arg " in
238+ # postgres --help | grep 'then exit'
239+ # leaving out -C on purpose since it always fails and is unhelpful:
240+ # postgres: could not access the server configuration file "/var/lib/postgresql/data/postgresql.conf": No such file or directory
241+ -' ?' |--help|--describe-config|-V|--version)
242+ return 0
243+ ;;
244+ esac
245+ done
246+ return 1
247+ }
248+
232249_main () {
233250 # if first arg looks like a flag, assume we want to run postgres server
234251 if [ " ${1: 0: 1} " = ' -' ]; then
235252 set -- postgres " $@ "
236253 fi
237254
238- if [ " $1 " = ' postgres' ]; then
255+ if [ " $1 " = ' postgres' ] && ! _pg_want_help " $@ " ; then
239256 docker_setup_env
240257 # setup data directories and permissions (when run as root)
241258 docker_create_db_directories
Original file line number Diff line number Diff line change @@ -229,13 +229,30 @@ docker_temp_server_stop() {
229229 pg_ctl -D " $PGDATA " -m fast -w stop
230230}
231231
232+ # check arguments for an option that would cause postgres to stop
233+ # return true if there is one
234+ _pg_want_help () {
235+ local arg
236+ for arg; do
237+ case " $arg " in
238+ # postgres --help | grep 'then exit'
239+ # leaving out -C on purpose since it always fails and is unhelpful:
240+ # postgres: could not access the server configuration file "/var/lib/postgresql/data/postgresql.conf": No such file or directory
241+ -' ?' |--help|--describe-config|-V|--version)
242+ return 0
243+ ;;
244+ esac
245+ done
246+ return 1
247+ }
248+
232249_main () {
233250 # if first arg looks like a flag, assume we want to run postgres server
234251 if [ " ${1: 0: 1} " = ' -' ]; then
235252 set -- postgres " $@ "
236253 fi
237254
238- if [ " $1 " = ' postgres' ]; then
255+ if [ " $1 " = ' postgres' ] && ! _pg_want_help " $@ " ; then
239256 docker_setup_env
240257 # setup data directories and permissions (when run as root)
241258 docker_create_db_directories
You can’t perform that action at this time.
0 commit comments