Don't actually try to start a server that is already running

This commit is contained in:
Dane Everitt
2020-08-19 19:20:46 -07:00
parent 9d2321f357
commit 43d8bd656a
2 changed files with 14 additions and 6 deletions

View File

@@ -199,8 +199,10 @@ func rootCmdRun(*cobra.Command, []string) {
// is that it was running, but we see that the container process is not currently running.
if r || (!r && s.IsRunning()) {
s.Log().Info("detected server is running, re-attaching to process...")
if err := s.HandlePowerAction(server.PowerActionStart); err != nil {
s.Log().WithField("error", errors.WithStack(err)).Warn("failed to properly start server detected as already running")
s.SetState(environment.ProcessRunningState)
if err := s.Environment.Attach(); err != nil {
s.Log().WithField("error", errors.WithStack(err)).Warn("failed to attach to running server environment")
}
return