From owner-freebsd-questions@freebsd.org Sat Aug 8 09:48:52 2020 Return-Path: Delivered-To: freebsd-questions@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 79FAA3A5E6D for ; Sat, 8 Aug 2020 09:48:52 +0000 (UTC) (envelope-from jerry@seibercom.net) Received: from mail-vs1-xe41.google.com (mail-vs1-xe41.google.com [IPv6:2607:f8b0:4864:20::e41]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 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 4BNy9H0H1yz4Yx1 for ; Sat, 8 Aug 2020 09:48:50 +0000 (UTC) (envelope-from jerry@seibercom.net) Received: by mail-vs1-xe41.google.com with SMTP id n25so1928544vsq.6 for ; Sat, 08 Aug 2020 02:48:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seibercom.net; s=google; h=date:from:to:subject:message-id:in-reply-to:references:reply-to :organization:mime-version; bh=n+JKM4DeOO/Fmn6sxO3yJ7A63Z2UpR0pF9xXW6ekiAA=; b=FlgwNGJE0gJPzxX4Kll0Hm8rO250EG+sOjVBYAIZiwdftdb4wniM+ovRjwuMzb8giF rRSrURP1u2ajJhXhfeou+Puz18BEjFZ0ITdcC0qrejV1xWAXr8x3hUtLMb+zZyyWLLkf GuP73tMaJsYvM66CqSMmylq12qt02MiRmaW7I= 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:subject:message-id:in-reply-to :references:reply-to:organization:mime-version; bh=n+JKM4DeOO/Fmn6sxO3yJ7A63Z2UpR0pF9xXW6ekiAA=; b=MsQ7R7rYA3lJqWcRRqi68xx45wDoaG9NCMEi4EKn7nOu/86vourU1aQF7y8opEgs1O TWCimcMb5zNlCavdyxrc0j7iROr27EHMFRwP4q0OncdFAzqAX8Lne29Q8w4DmFyV+yQC UrOsCIyel+3SzeWsseni9v4089ExAkJj+ggdSwIek0koo3OuDtgD7R3fz6swXwyWEvtK bbGkqXF/IEk8KxO0CBrxPKRe2EkXZXPV7K2cxDsSflwGRM1QYwrRKh71yfwH1Gaa5XOM lSWEw2Dz23ePKbYdJwuECsH5LshFqoZ4TRJAZbhK4aElC3KE+RTJd74p683PN+yol+TJ H6QQ== X-Gm-Message-State: AOAM5303IAxAaPK5n/eigaP/a1+vcjY0Qjtrd8dXJLSLWosRtRkwwUyZ n+z5+Sfu2JAvtPoYPZX4iU3RRxlA4E4= X-Google-Smtp-Source: ABdhPJzez8EGBmMWnfxo0l7BBg7JjmQfb4ZC4o2bsXRXB8Ut/zhrTLdsuj8OBqyt3YU3RsbyVaTPMw== X-Received: by 2002:ad4:576c:: with SMTP id r12mr18775309qvx.232.1596879632384; Sat, 08 Aug 2020 02:40:32 -0700 (PDT) Received: from scorpio.seibercom.net (cpe-174-109-231-236.nc.res.rr.com. [174.109.231.236]) by smtp.gmail.com with ESMTPSA id h24sm8701279qkk.72.2020.08.08.02.40.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 08 Aug 2020 02:40:30 -0700 (PDT) Received: from scorpio.seibercom.net (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by scorpio.seibercom.net (Postfix) with ESMTPS id 4BNxzd3R8rzwnb for ; Sat, 8 Aug 2020 05:40:29 -0400 (EDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.102.4 at scorpio.seibercom.net Date: Sat, 8 Aug 2020 05:40:23 -0400 From: Jerry To: "User Questions" Subject: Re: Best way to make a machine boot with or without a Internet connection Message-ID: <20200808054023.555f71ae@scorpio.seibercom.net> In-Reply-To: <20200807211945.ba8fe409.freebsd@edvax.de> References: <20200807211945.ba8fe409.freebsd@edvax.de> Reply-To: "User Questions" Organization: seibercom NET X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; amd64-portbld-freebsd11.4) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; boundary="Sig_/KzWuoTAH0RixSRuqF1xXEby"; protocol="application/pgp-signature" X-Rspamd-Queue-Id: 4BNy9H0H1yz4Yx1 X-Spamd-Bar: +++ Authentication-Results: mx1.freebsd.org; dkim=pass header.d=seibercom.net header.s=google header.b=FlgwNGJE; dmarc=none; spf=pass (mx1.freebsd.org: domain of jerry@seibercom.net designates 2607:f8b0:4864:20::e41 as permitted sender) smtp.mailfrom=jerry@seibercom.net X-Spamd-Result: default: False [3.04 / 15.00]; HAS_REPLYTO(0.00)[freebsd-questions@freebsd.org]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; HAS_ORG_HEADER(0.00)[]; RCVD_COUNT_THREE(0.00)[4]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[seibercom.net:+]; NEURAL_HAM_SHORT(-0.21)[-0.209]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; REPLYTO_EQ_TO_ADDR(5.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; RECEIVED_SPAMHAUS_PBL(0.00)[174.109.231.236:received]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.17)[-0.169]; R_DKIM_ALLOW(-0.20)[seibercom.net:s=google]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-0.98)[-0.982]; MIME_GOOD(-0.20)[multipart/signed,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org]; DMARC_NA(0.00)[seibercom.net]; RCPT_COUNT_ONE(0.00)[1]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::e41:from]; GREYLIST(0.00)[pass,body]; RCVD_TLS_ALL(0.00)[] X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 08 Aug 2020 09:48:52 -0000 --Sig_/KzWuoTAH0RixSRuqF1xXEby Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Fri, 7 Aug 2020 21:19:45 +0200, Polytropon stated: >On Fri, 7 Aug 2020 14:54:13 -0400, Aryeh Friedman wrote: >> On Fri, Aug 7, 2020 at 1:24 PM Mario Lobo wrote: >> =20 >> > On Thu, Aug 6, 2020 at 6:20 PM Aryeh Friedman >> > wrote: >> > =20 >> > > Due to storm related damage my ISP went out for a few (12) hours >> > > earlier =20 >> > in =20 >> > > the week and while I got it usable without a Internet connection >> > > by =20 >> > putting =20 >> > > everything in my LAN in /etc/hosts (I also run a local_unbound >> > > --> local bind9 on my file server which I have created a zone >> > > file for the LAN machines also), but it was very slow in booting >> > > due to ntpdate, tomcat =20 >> > and =20 >> > > sendmail not being to connect to the Internet for either forward >> > > or =20 >> > reverse =20 >> > > DNS. I don't want to turn these services off, but I want to be >> > > able to =20 >> > do =20 >> > > a normal boot (no long hangs) if the ISP goes down again. What >> > > is the best way to do this? >> > > >> > > -- >> > > Aryeh M. Friedman, Lead Developer, http://www.PetiteCloud.org >> > > _______________________________________________ >> > > freebsd-questions@freebsd.org mailing list >> > > https://lists.freebsd.org/mailman/listinfo/freebsd-questions >> > > To unsubscribe, send any mail to " >> > > freebsd-questions-unsubscribe@freebsd.org" >> > > =20 >> > >> > This is a long shot but perhaps you could find a way to start these >> > services in the background (&). >> > =20 >>=20 >> Given they are done by /etc/rc based on rc.onf not likely =20 > >The "problem" is that rc, in combination with rc.conf and >the responsible rc.d/ scripts, determines the order in which >certain services have to be started. A workaround would be >to use /etc/rc.local to manually do what rc would do with >its internal logic. Using this approach, you could set the >exact order as well as tests for "is currently connected >to the Internet", starting all subsequent tasks that do >require an online connection. You would put the first >steps into the background, using &, and you could then >even invoke "service netif start" (or parts thereof), >followed by your own services (such as ntp, webserver, >mailserver). Such a mechanism could be configured to >set a flag, for example stupidly simple as a "lock file", >and repeat to test for Internet availability until the >Internet becomes available - then stop. Some further >logic could be added to check if the connection stays >alive, and if it goes down, stop the services, remove >the lock file, and keep trying at a specified interval. > >Of course, this is all manual stuff, nothing is provided >by the OS to handle this in an appropriate fashion and >doesn't even look right... ;-) I saw something on the web a while ago that sort of addressed this sort of problem. The user ran a script via cron on boot-up that checked for a specific conditions then started 'monit' to start the appropriate applications. --=20 Jerry --Sig_/KzWuoTAH0RixSRuqF1xXEby Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEIQb/tTwl6I1ueEVtOHMGOIfexWQFAl8ucwcACgkQOHMGOIfe xWRYswgAjcy6FiN2ef3xu3OSiWIwk34+iRLOXO1C4/i4B3VKL8AvwXOtYzfZySvw RrQHT7x5iPXgvnYpMXdNJ/ydKLkrov2z6MA5ij8nHNq4xvCF3gRBZMHi23e/D2j0 QXOcssyf3FyuUO2MzpKbUU2Ze6BSn7emGFaSB3EJilgHNXU7XuXqQ/IDjZsM+37U nk5iBk7fjgKcfrj1rYyPgdGeh7UpbC1y3MzAITYsvdgF715Sx5DgqEBorc8d/LUa P7wcO0P/V6tAYLc1hUHU9MWJdKw6EomT2Qfx8BXozHywnxyDN1tIRTUpx0odH3PP XkvhxPmiPs9jaEa0uFUzHfYfOdUBYA== =uvmu -----END PGP SIGNATURE----- --Sig_/KzWuoTAH0RixSRuqF1xXEby--