Various improvements and bug fixes

- Watch more events for lease file changes
 - Improving network up detection by using bootstrap IPv6 along side
   IPv4 one.
 - Emitting log to notice user that ctrld is starting.
 - Using systemd wrapper to provide correct status.
 - Restoring DNS on stop on Windows.
This commit is contained in:
Cuong Manh Le
2023-08-14 21:22:11 +07:00
committed by Cuong Manh Le
parent 0c096d5f07
commit 4896563e3c
9 changed files with 63 additions and 44 deletions
+1 -1
View File
@@ -53,7 +53,7 @@ func (d *dhcp) watchChanges() {
if !ok {
return
}
if event.Has(fsnotify.Write) {
if event.Has(fsnotify.Write) || event.Has(fsnotify.Rename) || event.Has(fsnotify.Chmod) || event.Has(fsnotify.Remove) {
format := clientInfoFiles[event.Name]
if err := d.readLeaseFile(event.Name, format); err != nil && !os.IsNotExist(err) {
ctrld.ProxyLogger.Load().Err(err).Str("file", event.Name).Msg("leases file changed but failed to update client info")