From owner-freebsd-questions@freebsd.org Tue May 14 22:43:08 2019 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8D4B5159AD2B for ; Tue, 14 May 2019 22:43:08 +0000 (UTC) (envelope-from rwmaillists@googlemail.com) Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 593A787E63; Tue, 14 May 2019 22:43:07 +0000 (UTC) (envelope-from rwmaillists@googlemail.com) Received: by mail-wm1-x331.google.com with SMTP id j187so616283wmj.1; Tue, 14 May 2019 15:43:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=BatDypocr+MrnnG9FAYsBSUDBhheFdVtMzyo8sQ6jDs=; b=KImEERvhlTmM8kSmST3rGk+eII/upN74JPeTzaEeGsRpiGEJ1JDstPEhBEXHoVX5Kp 82kJHc0URx9QYrDLiIKcMvDJ1+O0FCeWUQcJIZKWCwePI2iifBenPbc70sF0HqFy7854 hqpj18aukqWIizMWYTJ3RkYI1MAPc6Vn7pO3vge4TaItJg0s8CPkslRrWpx9AyO/R67D DSCaB1lMIQ0Le+GzL3SSZTo03j6UPw4QGuW5D22DKCdfCaok7xwNWLjHSn1spPRnwSM2 ODIgHUD2MLpzJlwfyCsvfPj90bB1O9oh4UMRMpnqjQ6XzdwNlrU7tEo+wbGYnT2J7eaE 35cg== X-Gm-Message-State: APjAAAU+D4t53ckoKBlGFJAF+GOfGf2OL5bG8mhe6scTzEGQcOEs1/w6 dS5KExLcI8nyyV+1lSblTiy60uLPio4= X-Google-Smtp-Source: APXvYqw1hlZLZBGHdfYwkZVq0cerB+b/fAXafdUnqUHg8NfCyD9OiBaoH+wcNrlJldpJRMljOIrVng== X-Received: by 2002:a1c:7518:: with SMTP id o24mr20489494wmc.42.1557873784909; Tue, 14 May 2019 15:43:04 -0700 (PDT) Received: from gumby.homeunix.com ([2.121.234.71]) by smtp.gmail.com with ESMTPSA id j190sm471350wmb.19.2019.05.14.15.43.03 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 14 May 2019 15:43:04 -0700 (PDT) Date: Tue, 14 May 2019 23:43:01 +0100 From: RW To: freebsd-questions@freebsd.org Cc: mandree@FreeBSD.org Subject: Re: rcorder - wait for tap0 Message-ID: <20190514234301.0f28c432@gumby.homeunix.com> In-Reply-To: <20190514220824.a4779bb2.freebsd@edvax.de> References: <20190514182945.0ced24d4@gumby.homeunix.com> <20190514185340.0159358c@gumby.homeunix.com> <63fe68c5-b85b-7d6d-a438-596ec8041f6b@nethead.se> <20190514220824.a4779bb2.freebsd@edvax.de> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; amd64-portbld-freebsd12.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 593A787E63 X-Spamd-Bar: ------ X-Spamd-Result: default: False [-6.71 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; FREEMAIL_FROM(0.00)[googlemail.com]; TO_DN_NONE(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[googlemail.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[googlemail.com,quarantine]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.94)[-0.944,0]; RECEIVED_SPAMHAUS_PBL(0.00)[71.234.121.2.zen.spamhaus.org : 127.0.0.10]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[googlemail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; DWL_DNSWL_NONE(0.00)[googlemail.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[googlemail.com:s=20161025]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; IP_SCORE(-2.75)[ip: (-9.23), ipnet: 2a00:1450::/32(-2.21), asn: 15169(-2.27), country: US(-0.06)]; RCVD_IN_DNSWL_NONE(0.00)[1.3.3.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 May 2019 22:43:08 -0000 On Tue, 14 May 2019 22:08:24 +0200 Polytropon wrote: > On Tue, 14 May 2019 21:39:26 +0200, Per olof Ljungmark wrote: > > On 2019-05-14 19:53, RW via freebsd-questions wrote: > > > On Tue, 14 May 2019 18:29:45 +0100 > > > RW wrote: > > > > > >> On Tue, 14 May 2019 08:49:52 +0200 > > >> Per olof Ljungmark wrote: > > >> > > >>> Despite large amounts of cofee and time I cannot grasp how to > > >>> make this happen. > > >>> > > >>> What I want is > > >>> > > >>> Boot -> start openvpn/tap0 configured -> start named -> start > > >>> jails > > >>> > > >>> Because the jails uses tap0 of course they cannot start before > > >>> tap0 is up, but this is what happens in the default > > >>> configuration. > > >>> > > >>> Surely this cannot be unique? How did you do it? > > >>> > > >>> Preferrably without messing with rc.d scripts that gets > > >>> overwritten when updated. > > >> > > >> You need an rc script in /usr/local/etc/rc.d with something like: > > >> > > >> > > >> # PROVIDE: vpnwait > > >> # REQUIRE: openvpn > > >> # BEFORE: > > > > > > now I come to think about it openvpn runs after LOGIN, so either > > > you have to put up with the order > > > > > > named, openvpn, jails > > > > > > or rewrite the openvpn script. > > > > > > What I did was to allow DNS to pass directly to one well-known > > > server so lookups could happen before openvpn started. > > > > Thank you for your comments. > > > > Thing is named dies if tap0 is not up when it starts and as this is > > a public named server it needs to be running after boot. > > > > Rewriting the provided rc scripts, they are part of the port and > > requires work when updated. > > > > So, the conlusion is, fiddle with the ule/rc.d/ and prepare to fix > > them after every update? No other way? > > There is another way, but it doesn't sound much better: > > You could use /etc/rc.local to implement the exact order in > which you need to start the different services, without using > their automatic startup (*_enable="YES" in combination with > the /etc/rc.d/ and /usr/local/etc/rc.d/ scripts). > A variant of that idea would be to set openvpn_enable=NO and run the installed openvpn script from a wrapper rc script using 'onestart' I've CCed the port maintainer just in case he's not aware of the issue. Starting openvpn that late is fine for a VPN server, but for a client it needs to run earlier. There are things that need internet access during boot and typically access is blocked by the firewall until the tun/tap interface comes up.