Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log messages report newlines in "old" #21

Open
DanaGoyette opened this issue Jan 25, 2024 · 3 comments
Open

Log messages report newlines in "old" #21

DanaGoyette opened this issue Jan 25, 2024 · 3 comments

Comments

@DanaGoyette
Copy link

DanaGoyette commented Jan 25, 2024

EDIT: somehow I must've hit enter before typing this out?

After the latest ip6neigh update, I've noticed that the logging shows weird newlines in the old-name parts of messages:

Thu Feb  1 11:55:24 PST 2024 Unknown host qbittorrent
qbittorrent now has got a proper name. Replacing all entries.
Thu Feb  1 11:55:24 PST 2024 Renamed host: qbittorrent
qbittorrent to qbittorrent
Thu Feb  1 11:55:26 PST 2024 Unknown host EAP670
EAP670 now has got a proper name. Replacing all entries.
Thu Feb  1 11:55:26 PST 2024 Renamed host: EAP670
EAP670 to EAP670
@cvmiller
Copy link
Collaborator

Please provide more information (copy of the log, description of what is incorrect, etc)

@DanaGoyette
Copy link
Author

DanaGoyette commented Feb 1, 2024

Somehow I must've sent this before I finished typing it. My guess is that the grep is getting confused by the /tmp/hosts/ip6neigh.bak file that keeps getting automatically created.

In ip6neigh-svc.sh:

        #Must save changes to another temp file and then move it over the main file.
        Change name in-place with SED
        sed -i.bak "s/ ${oldname}/ ${newname}/g" "$HOSTS_FILE"

        #Deletes the old cached entry if dynamic.
        # Delete with SED
        sed -i.bak "/0. ${oldname}$/d" "$CACHE_FILE"
        ```

@DanaGoyette
Copy link
Author

DanaGoyette commented Feb 3, 2024

I did a bit more investigating, by making the get_name function in ip6neigh-svc.sh print the match, and yes, with that .bak file, I see two lines for the same hostname.

Seems like the simplest fix is to remove the .bak from calls to sed -i.bak.

Is it possible that these bogus renames ("hostname\nhostname" to "hostname") are causing my extra dnsmasq restarts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants