From owner-freebsd-questions@freebsd.org Sat Aug 8 16:25:32 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 D5B753AF91D for ; Sat, 8 Aug 2020 16:25:32 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.135]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "mout.kundenserver.de", Issuer "TeleSec ServerPass Class 2 CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4BP6yz3wc4z46cb for ; Sat, 8 Aug 2020 16:25:31 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from r56.edvax.de ([188.102.98.146]) by mrelayeu.kundenserver.de (mreue010 [212.227.15.167]) with ESMTPA (Nemesis) id 1Mz9pT-1kz8wc0t3z-00wH1S for ; Sat, 08 Aug 2020 18:25:29 +0200 Date: Sat, 8 Aug 2020 18:25:28 +0200 From: Polytropon To: freebsd-questions@freebsd.org Subject: Re: Best way to make a machine boot with or without a Internet connection Message-Id: <20200808182528.371dbadf.freebsd@edvax.de> In-Reply-To: <20200808054023.555f71ae@scorpio.seibercom.net> References: <20200807211945.ba8fe409.freebsd@edvax.de> <20200808054023.555f71ae@scorpio.seibercom.net> Reply-To: Polytropon Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:meATFPArp0/j88jK7vPtVNG9B6kblQmgVoZamj9CQ8j2lR4zNKC cbLwxSGVvoQmEmqocKAC6jKfFde76JB6Jm+v4g6afJ3407YRV7gmQ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: 4BP6yz3wc4z46cb X-Spamd-Bar: +++ Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of freebsd@edvax.de has no SPF policy when checking 212.227.126.135) smtp.mailfrom=freebsd@edvax.de X-Spamd-Result: default: False [3.63 / 15.00]; HAS_REPLYTO(0.00)[freebsd@edvax.de]; RCVD_VIA_SMTP_AUTH(0.00)[]; MV_CASE(0.50)[]; TO_DN_NONE(0.00)[]; HAS_ORG_HEADER(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[188.102.98.146:received]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; ASN(0.00)[asn:8560, ipnet:212.227.0.0/16, country:DE]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ARC_NA(0.00)[]; REPLYTO_EQ_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_SPAM_SHORT(0.01)[0.006]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org]; AUTH_NA(1.00)[]; NEURAL_SPAM_MEDIUM(0.29)[0.292]; RCPT_COUNT_ONE(0.00)[1]; DMARC_NA(0.00)[edvax.de]; NEURAL_SPAM_LONG(0.93)[0.934]; MID_CONTAINS_FROM(1.00)[]; RCVD_IN_DNSWL_NONE(0.00)[212.227.126.135:from]; R_SPF_NA(0.00)[no SPF record]; RWL_MAILSPIKE_POSSIBLE(0.00)[212.227.126.135:from]; RCVD_COUNT_TWO(0.00)[2] 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 16:25:32 -0000 On Sat, 8 Aug 2020 05:40:23 -0400, Jerry wrote: > 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: > >> > >> > On Thu, Aug 6, 2020 at 6:20 PM Aryeh Friedman > >> > wrote: > >> > > >> > > Due to storm related damage my ISP went out for a few (12) hours > >> > > earlier > >> > in > >> > > the week and while I got it usable without a Internet connection > >> > > by > >> > putting > >> > > 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 > >> > and > >> > > sendmail not being to connect to the Internet for either forward > >> > > or > >> > reverse > >> > > DNS. I don't want to turn these services off, but I want to be > >> > > able to > >> > do > >> > > 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" > >> > > > >> > > >> > This is a long shot but perhaps you could find a way to start these > >> > services in the background (&). > >> > > >> > >> Given they are done by /etc/rc based on rc.onf not likely > > > >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. If I remember correctly, systemd is _the_ tool to deal with this kind of situation... ;-) -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...