github.com/canhui/fabric_ca2_2@v2.0.0-alpha+incompatible/images/fabric-ca-fvt/payload/start.sh (about) 1 #!/bin/bash 2 # 3 # Copyright IBM Corp. All Rights Reserved. 4 # 5 # SPDX-License-Identifier: Apache-2.0 6 # 7 8 POSTGRES_PORT=5432 9 MYSQL_PORT=3306 10 LDAP_PORT=389 11 PORTS=($POSTGRES_PORT $MYSQL_PORT $LDAP_PORT) 12 13 timeout=12 14 su postgres -c 'postgres -D /usr/local/pgsql/data' & 15 chown -R mysql.mysql $MYSQLDATA 16 /usr/bin/mysqld_safe --sql-mode=STRICT_TRANS_TABLES & 17 /etc/init.d/slapd start & 18 19 for port in ${PORTS[*]}; do 20 i=0 21 while ! nc -zvnt -w 5 $HOSTADDR $port; do 22 sleep 1 23 test $i -gt $timeout && break 24 let i++; 25 done 26 done 27 28 exec "$@"