@@ -334,8 +334,7 @@ func (m ModJobSshStruct) setupClusterInner(clusterConf clusterconf.ClusterConfYm
334334 }
335335 _ = base64 .StdEncoding .EncodeToString (pubkeybytes )
336336
337- // output, logfps :=
338- util .StartRemoteCmds (
337+ output , _ := util .StartRemoteCmds (
339338 hosts ,
340339
341340 util .ModRunCmd .CmdModels ().InstallTelegoWithPy ()+ " && " +
@@ -348,17 +347,18 @@ func (m ModJobSshStruct) setupClusterInner(clusterConf clusterconf.ClusterConfYm
348347 // fmt.Println(color.RedString("read logfdebug failed: %v", err))
349348 // os.Exit(1)
350349 // }
351- // srcs := []string{output[0], string(logfdebug)}
352- // keywords := []string{"error", "失败"}
353- // if funk.Any(srcs, func(src string) bool {
354- // return funk.Any(keywords, func(keyword string) bool {
355- // return strings.Contains(src, keyword)
356- // })
357- // }) {
358- // fmt.Println(color.RedString("ssh error: %s", output))
359- // // debug sshd_config
360- // util.ModRunCmd.NewBuilder("cat", "/etc/ssh/sshd_config").WithRoot().ShowProgress().BlockRun()
361- // }
350+ srcs := []string {output [0 ]}
351+ keywords := []string {"Error Process exited" }
352+ if funk .Any (srcs , func (src string ) bool {
353+ return funk .Any (keywords , func (keyword string ) bool {
354+ return strings .Contains (src , keyword )
355+ })
356+ }) {
357+ fmt .Println (color .RedString ("ssh setup remote pubkey error: %s" , output ))
358+ os .Exit (1 )
359+ // // debug sshd_config
360+ // util.ModRunCmd.NewBuilder("cat", "/etc/ssh/sshd_config").WithRoot().ShowProgress().BlockRun()
361+ }
362362}
363363
364364// https://qcnoe3hd7k5c.feishu.cn/wiki/V6eHwZm1aiofeykaSd5cmgPcnSe#share-Hc1hdGT26oI4I0xPaplcEhMundd
0 commit comments