f-77: dhcp: arrêt propre sur SIGTERM, socket de contrôle retirée au teardown #77

Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
GnomeZworc 2026-10-19 16:06:49 +02:00
commit ecaa34d686
Signed by: nicolas.boufideline
GPG key ID: 4406BBBF8845D632
8 changed files with 178 additions and 10 deletions

View file

@ -107,7 +107,14 @@ func (b Two) TeardownSubnet(s Subnet) error {
}
}
return statefile.Remove(b.statePath(s))
return b.removeFiles(s)
}
func (b Two) removeFiles(s Subnet) error {
if err := statefile.Remove(b.statePath(s)); err != nil {
return err
}
return statefile.Remove(dhcpapi.SocketPath(b.runDir(), s.Instance()))
}
func (b Two) SetVM(s Subnet, vmName string, res []Reservation) error {