Re: Can unison better help with renamed hosts?
Tõivo Leedjärv <[email protected]> Wed, 24 Apr 2024 13:49:57 +0200
| Newsgroups | gmane.network.unison.general |
|---|---|
| Message-ID | <CAALvpZQ2G8ACvJFG9xSk=j=jdW_GLM+wK-04ZV8uamJ-jVAstA@mail.gmail.com> |
On Wed, 24 Apr 2024 at 13:41, 'Mario Emmenlauer' via unison-users <[email protected]> wrote: > > I may have created some confusion about this. For my specific problem, > and other people may see this differently, I only care what host name > unison detected. I can easily take responsibility that the login to > the remote host works, because these errors are well explained in the > unison (or ssh) error messages. But _after_ unison logged into the > remote host, it does some magic (explained by you below, I see) to > check if the detected host name and the expected host name match. This > part is a black box for me, and not easy to understand/debug. I was not precise enough. I did have in mind exactly the scenario you mentioned. Even after the connection has been established, Unison won't know what it's expected to have as the hostname. How could it? If gethostname(3) gives a different name, if UNISONLOCALHOST has been (re)set, what to believe, what to trust? Can't scan for existing archive files either, because you may be syncing between multiple hosts. Also, UNISON env var can cause different archive files to be seen. So, as funny as it may sound, Unison wouldn't know what hostname it used during previous syncs. > > - Unison gets each host's name by gethostname(3), which can be > > overridden by env var UNISONLOCALHOSTNAME on both server and client, > > and also by pref "clientHostName" on client only. > > Do I understand correctly that unison will call gethostname(3) on each > host, and use that for the names? That confuses me, because gethostname That is correct (unless overridden). > on the remote machine should not change, depending on whether I'm inside > or outside the company network. The server always reports the same when > you call hostname, no? It would appear that in your case it doesn't. But adding -showarchive on the command line should help you debug the issue at least. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].