Signed-off-by: hanzhixiao <709674996@qq.com>
pull/828/head
hanzhixiao 2 years ago
parent ee8a157084
commit afc4e23f65

@ -70,13 +70,14 @@ cd $SCRIPTS_ROOT
# FIXME Put the shell script names here # FIXME Put the shell script names here
need_to_start_server_shell=( need_to_start_server_shell=(
start_component_check.sh
start_rpc_service.sh start_rpc_service.sh
push_start.sh push_start.sh
msg_transfer_start.sh msg_transfer_start.sh
msg_gateway_start.sh msg_gateway_start.sh
start_cron.sh start_cron.sh
) )
chmod +x $i
start_component_check.sh
# Loop through the script names and execute them # Loop through the script names and execute them
for i in ${need_to_start_server_shell[*]}; do for i in ${need_to_start_server_shell[*]}; do

@ -35,4 +35,8 @@ cmd="./${component_check}"
echo "==========================start components checking===========================">>$OPENIM_ROOT/logs/openIM.log echo "==========================start components checking===========================">>$OPENIM_ROOT/logs/openIM.log
$cmd $cmd
if [ $? -eq 0 ]; then
exit 1
fi

@ -28,7 +28,7 @@ import (
const ( const (
cfgPath = "../../../../../config/config.yaml" cfgPath = "../../../../../config/config.yaml"
minioHealthCheckDuration = 1 minioHealthCheckDuration = 1
maxRetry = 10000 maxRetry = 100
componentStartErrCode = 6000 componentStartErrCode = 6000
configErrCode = 6001 configErrCode = 6001
) )
@ -78,6 +78,7 @@ func main() {
// Check Minio // Check Minio
if err := checkMinio(); err != nil { if err := checkMinio(); err != nil {
if index := strings.Index(err.Error(), utils.IntToString(configErrCode)); index != -1 { if index := strings.Index(err.Error(), utils.IntToString(configErrCode)); index != -1 {
successPrint(fmt.Sprint("Minio starts successfully"))
warningPrint(fmt.Sprintf("%v. Please modify your config file", err.Error())) warningPrint(fmt.Sprintf("%v. Please modify your config file", err.Error()))
} else { } else {
errorPrint(fmt.Sprintf("Starting Minio failed: %v. Please make sure your Minio service has started", err.Error())) errorPrint(fmt.Sprintf("Starting Minio failed: %v. Please make sure your Minio service has started", err.Error()))
@ -110,8 +111,9 @@ func main() {
successPrint(fmt.Sprint("Kafka starts successfully")) successPrint(fmt.Sprint("Kafka starts successfully"))
} }
successPrint(fmt.Sprint("All components starts successfully")) successPrint(fmt.Sprint("All components starts successfully"))
break os.Exit(0)
} }
os.Exit(1)
} }
func exactIP(urll string) string { func exactIP(urll string) string {
@ -275,5 +277,5 @@ func successPrint(s string) {
} }
func warningPrint(s string) { func warningPrint(s string) {
fmt.Printf("\x1b[%dmWarning: %v\x1b[0m\n", 33, s) fmt.Printf("\x1b[%dmWarning: But %v\x1b[0m\n", 33, s)
} }

Loading…
Cancel
Save