Guardian failure gives exit 0 on jvm termination

I have akka.coordinated-shutdown.exit-code = 1.

If I execute ActorSystem(Behaviors.empty, "sys").terminate() it will exit with code 1.

  ActorSystem[Nothing](Behaviors.setup[Nothing](_ => {
    throw new Exception("Aaaaa!")
    Behaviors.empty
  }), "sys")

Returns 0 (after logging " guardian failed, shutting down system")

How should I make exceptional failures return non-zero exit codes?

Ubuntu / Akka 2.6.16

I guess… it’s because it never stopped. If it starts and throws an exception, then it stops, but not before.

Is there a nice way of making it handle exceptions on startup, or is it just “don’t”? (i.e. Just start other actors and monitor them)

I think there could be something missing here. Please create an issue Issues · akka/akka · GitHub