From owner-freebsd-questions@freebsd.org Sat Aug 8 17:05:49 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 70D17378CB7 for ; Sat, 8 Aug 2020 17:05:49 +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 4BP7sS2f64z48jK for ; Sat, 8 Aug 2020 17:05:48 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from r56.edvax.de ([188.102.98.146]) by mrelayeu.kundenserver.de (mreue012 [212.227.15.167]) with ESMTPA (Nemesis) id 1MwjO6-1kwfTM0E2c-00yD70; Sat, 08 Aug 2020 19:05:46 +0200 Date: Sat, 8 Aug 2020 19:05:45 +0200 From: Polytropon To: Ernie Luzar Cc: freebsd-questions@freebsd.org Subject: Re: Best way to make a machine boot with or without a Internet connection Message-Id: <20200808190545.20610591.freebsd@edvax.de> In-Reply-To: <5F2ED8CA.3070201@gmail.com> References: <20200807211945.ba8fe409.freebsd@edvax.de> <20200808054023.555f71ae@scorpio.seibercom.net> <20200808182528.371dbadf.freebsd@edvax.de> <5F2ED8CA.3070201@gmail.com> 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:YwxX23OJ5V7ZtoWfvIkRFqAH968PnxyakkkbnLMjUyMgiDGYpI2 y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zlvLK3nmDJTcVrdNOnD6feF2PuRuvg0u9HY0K5NCPKKT X-Rspamd-Queue-Id: 4BP7sS2f64z48jK 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 [2.54 / 15.00]; HAS_REPLYTO(0.00)[freebsd@edvax.de]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; MV_CASE(0.50)[]; HAS_ORG_HEADER(0.00)[]; NEURAL_HAM_SHORT(-0.44)[-0.443]; RCPT_COUNT_TWO(0.00)[2]; FREEMAIL_TO(0.00)[gmail.com]; RECEIVED_SPAMHAUS_PBL(0.00)[188.102.98.146:received]; RCVD_TLS_LAST(0.00)[]; R_DKIM_NA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:8560, ipnet:212.227.0.0/16, country:DE]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.02)[-0.021]; REPLYTO_EQ_FROM(0.00)[]; FROM_HAS_DN(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[edvax.de]; AUTH_NA(1.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; NEURAL_SPAM_LONG(0.60)[0.603]; 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 17:05:49 -0000 On Sat, 08 Aug 2020 12:54:34 -0400, Ernie Luzar wrote: > Polytropon wrote: > > 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... ;-) > > > > Is systemd part of the base OS or a port? It's a GNU/Linux core component (adopted by most distributions) and often seen as the best advertisement to use FreeBSD. :-) -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...