@@ -26,8 +26,12 @@ func (e Embedded) ETCD(args ETCDConfig) error {
 	}
 
 	go func() {
-		err := <-etcd.Err()
-		logrus.Fatalf("etcd exited: %v", err)
+		select {
+		case <-etcd.Server.StopNotify():
+			logrus.Fatalf("etcd stopped - if this node was removed from the cluster, you must backup and delete %s before rejoining", args.DataDir)
+		case err := <-etcd.Err():
+			logrus.Fatalf("etcd exited: %v", err)
+		}
 	}()
 	return nil
 }
// +build !no_embedded_executor

package executor

import (
	"github.com/sirupsen/logrus"
	"go.etcd.io/etcd/embed"
)

func (e Embedded) CurrentETCDOptions() (InitialOptions, error) {
	return InitialOptions{}, nil
}

func (e Embedded) ETCD(args ETCDConfig) error {
	configFile, err := args.ToConfigFile()
	if err != nil {
		return err
	}
	cfg, err := embed.ConfigFromFile(configFile)
	if err != nil {
		return err
	}
	etcd, err := embed.StartEtcd(cfg)
	if err != nil {
		return nil
	}

	go func() {
		err := <-etcd.Err()
		logrus.Fatalf("etcd exited: %v", err)
	}()
	return nil
}

so just to clarify this is for the case that the node was removed via kubectl and etcd stopped on that node, I am not sure how is that helpful if its not repeatable i.e if the etcd stopped and then it exited with a fatal error then rke2 will restart again if it ran via systemd