Tinc1.1 generates Port automatically when port is occupied

Guus Sliepen guus at tinc-vpn.org
Tue Feb 10 07:21:39 CET 2015


On Mon, Feb 09, 2015 at 10:46:09PM +0100, Eric Feliksik wrote:

> > That's true. I could make it skip the automatic port selection step if
> > it's not running in an interactive TTY.
> 
> Yes, that would be an improvement IMO. I must say that *I* do not really
> like such differences in behavior much, though. I would personally opt for
> making the choice interactive, then ("do you want to (F)orce the generation
> of port=655 or (R)andomly pick another available port? F/R: "). Then it is
> still super easy to use and very obvious that this qbehavior will not work
> in non-interactive scripts. But this is a bit subjective, now I may be
> conceived as pedantic :-)

Ok, that might be doable. It already asks for a Name if you didn't
provide one on the command line when running tinc init.

> What I do is generate a tinc config with ansible. If I have to generate a
> new one, I delete the configuration directory and run the ansible script
> again. I do not kill tincd. So when ansible then runs the tinc 1.1
> configuration commands, the configuration process is so clever to note the
> port is not available and generates a new port. Then ansible restarts
> tincd. Then tincd is on the random port. If I then again run ansible, this
> time it succeeds binding to 655, as it became free when ansible restarted
> tinc. Hence it will work if you run it a even number of times.
> 
> You can of course stop tinc before running ansible, but the point is simply
> that nobody expects a running tincd to influence the behavior of the
> configuration generating tinc.

I see. Well, deleting the configuration directory from a program that is
still running is not very nice, but I see how that might happen with
something like Ansible.

-- 
Met vriendelijke groet / with kind regards,
     Guus Sliepen <guus at tinc-vpn.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://www.tinc-vpn.org/pipermail/tinc/attachments/20150210/3c51eca2/attachment.sig>


More information about the tinc mailing list