Revert "common/daemon: add a method to reexec itself"

This reverts commit 216786d40e. We don't
really need that if we move logic to cmd package.
This commit is contained in:
Vincent Bernat
2025-09-19 07:20:49 +02:00
parent 9f34f9caf9
commit 75f6908f71
4 changed files with 4 additions and 67 deletions

View File

@@ -5,7 +5,6 @@ package daemon
import (
"errors"
"os"
"syscall"
"testing"
"testing/synctest"
@@ -63,28 +62,6 @@ func TestTerminateWithSignal(t *testing.T) {
}
}
func TestReexecWithSignal(t *testing.T) {
r := reporter.NewMock(t)
c, err := New(r)
if err != nil {
t.Fatalf("New() error:\n%+v", err)
}
helpers.StartStop(t, c)
c.Reexec()
if os.Getenv("TEST_DAEMON_REEXEC") == "1" {
// This is a way to increase a bit coverage
executable, _ := os.Executable()
os.Remove(executable)
c.FinishReexec()
return
}
os.Setenv("TEST_DAEMON_REEXEC", "1")
c.FinishReexec()
t.Fatalf("No reexec done!")
}
func TestStop(t *testing.T) {
r := reporter.NewMock(t)
c, err := New(r)