From owner-freebsd-net@freebsd.org Thu Mar 26 15:50:19 2020 Return-Path: Delivered-To: freebsd-net@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 14C792A2FC8; Thu, 26 Mar 2020 15:50:19 +0000 (UTC) (envelope-from freebsd@qeng-ho.org) Received: from bede.qeng-ho.org (bede.qeng-ho.org [217.155.128.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 48p8ZB5kPLz4VHL; Thu, 26 Mar 2020 15:49:54 +0000 (UTC) (envelope-from freebsd@qeng-ho.org) Received: from arthur.home.qeng-ho.org (arthur.home.qeng-ho.org [172.23.1.2]) by bede.qeng-ho.org (Postfix) with ESMTP id C6DA210671; Thu, 26 Mar 2020 15:49:42 +0000 (GMT) Subject: Re: IPv6 in jails To: Victor Sudakov , "Bjoern A. Zeeb" Cc: freebsd-net@freebsd.org, Miroslav Lachman <000.fbsd@quip.cz>, freebsd-questions@freebsd.org References: <20200318151556.GA64871@admin.sibptus.ru> <2dd539ed-0ee3-079b-27b2-28126056c69a@quip.cz> <20200318155046.GD65497@admin.sibptus.ru> <4CA69535-0F6C-40FC-83CF-5000FD728C2D@lists.zabbadoz.net> <20200319021432.GA80800@admin.sibptus.ru> <01EF7656-4F8A-4075-A0B4-27E8AB17B516@lists.zabbadoz.net> <20200319140132.GA93947@admin.sibptus.ru> From: Arthur Chance Message-ID: Date: Thu, 26 Mar 2020 15:49:42 +0000 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:68.0) Gecko/20100101 Thunderbird/68.3.1 MIME-Version: 1.0 In-Reply-To: <20200319140132.GA93947@admin.sibptus.ru> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 48p8ZB5kPLz4VHL X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of freebsd@qeng-ho.org designates 217.155.128.241 as permitted sender) smtp.mailfrom=freebsd@qeng-ho.org X-Spamd-Result: default: False [-4.83 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:217.155.128.240/29]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; SURBL_MULTI_FAIL(0.00)[query timed out]; DMARC_NA(0.00)[qeng-ho.org]; RCPT_COUNT_FIVE(0.00)[5]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_TLS_LAST(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:13037, ipnet:217.155.0.0/16, country:GB]; MID_RHS_MATCH_FROM(0.00)[]; IP_SCORE(-2.53)[ip: (-7.85), ipnet: 217.155.0.0/16(-3.92), asn: 13037(-0.79), country: GB(-0.07)]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Mar 2020 15:50:19 -0000 On 19/03/2020 14:01, Victor Sudakov wrote: > Bjoern A. Zeeb wrote: >> >>>> If it does, can you add a >>>> >>>> exec.start += "sleep 2 "; >>>> >>>> to your config >>> >>> OK, I've added it to the configs of 3 experimental jails. >>> >>>> and see if your problem goes away? >>> >>> It goes away partially (only for sshd in 2 of the 3 available jails), >>> and >>> not for syslogd in any of the 3 available jails. Restarting the daemons >>> from within the jail fixes the problem. An example from a problem jail: >>> >> .. >>> >>>> If it does, the reason is >>>> that you configure an IPv6 address to an interface and DUD has not >>>> yet >>>> completed by the time sshd or other daemons start. Giving it the 2 > > What is "DUD" BTW? > I suspect it's a typo for DAD - duplicate address detection which is part of IPv6. >>>> seconds >>>> avoids this problem and the address is usable at that time. >>> >>> There is obviously a race somewhere, but the 2 second sleep does not >>> eliminate it entirely. >> >> Well not so much of a race but than a “gap”. >> >> The point is you are configuring an address on the base system and the jail >> knows nothing about it so it’ll simply start the daemons. Normally the >> startup scripts would do the right thing. >> >> I don’t think “polluting” jail(8) with logic to check that the addresses >> become available or not is a good idea. However I agree that it should >> automatically do the right thing somehow .. >> >> >> >>> Thank you for the hint in the right direction, what would you suggest >>> further? >> >> If you make it 3 seconds, does it deterministically work then? > > Not quite: https://termbin.com/arvb > syslogd sometimes remains deprived of the IPv6 address. > -- Violets are red And roses are blue When metamaterials Alter their hue.