Skip to content

Commit 5ca106d

Browse files
committed
make sure to pkill rmb before starting
1 parent 16b6d37 commit 5ca106d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

cmds/modules/noded/twin.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,17 @@ func withDefaultPort(substrateUrl string) (string, error) {
3838
return u.String(), nil
3939
}
4040

41+
func pkill(ps string) error {
42+
return exec.Command("pkill", "-9", ps).Run()
43+
}
44+
4145
func runMsgBus(ctx context.Context, sk ed25519.PrivateKey, substrateURLs []string, relayAddr []string, redisAddr string) error {
46+
// todo: this is a hack to make sure that no other rmb instances running on the node
47+
// that are not managed by noded. I only saw this one time but no harm of being careful
48+
if err := pkill("rmb"); err != nil {
49+
log.Debug().Err(err).Msg("no rmb processes killed")
50+
}
51+
4252
// select the first one as only one URL is set for now
4353
if len(substrateURLs) == 0 {
4454
return errors.New("at least one substrate URL must be provided")

0 commit comments

Comments
 (0)