From owner-freebsd-questions@freebsd.org Sat Aug 8 16:54:38 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 613DB37856A for ; Sat, 8 Aug 2020 16:54:38 +0000 (UTC) (envelope-from luzar722@gmail.com) Received: from mail-qk1-x736.google.com (mail-qk1-x736.google.com [IPv6:2607:f8b0:4864:20::736]) (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 4BP7cY0btdz48J8 for ; Sat, 8 Aug 2020 16:54:36 +0000 (UTC) (envelope-from luzar722@gmail.com) Received: by mail-qk1-x736.google.com with SMTP id 2so4565036qkf.10 for ; Sat, 08 Aug 2020 09:54:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-transfer-encoding; bh=xDaBeCgCC49RwC2mHkaYVVI4WhfeiBm8JHCrhROY204=; b=IZo0C7HP2t37CWgZKb39yFnyGigQh0DtWe5DPC//hPOPsSQ2qCZahYx+IZ4/unW+N2 wocUmAkl7H73v9817U5oST1Bxw3w9o/ymPAkv0VmeaLci5y7cUCuQVJiUNLFlG4xC6r0 aBIGyKHyZGEguDDi2l+XLPo+c9N2+g5BDntMqA+qXqifqWo3F1az0ClJAbNc/Weud5j4 IIZImyNWBuQBT16XWY1OaxHalJ71RXy4bAFvqJPFt3vNEvoVW0nOgnicaGSCo0jwjiGX HwSV0/9w4ebqMpAY3GGaViqidOGow8WO0Qx2pqw2+zWEMrdaSJhiQRKR7LrPOsvHqMi4 HToA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-transfer-encoding; bh=xDaBeCgCC49RwC2mHkaYVVI4WhfeiBm8JHCrhROY204=; b=HDSknDJO3TEu+aWlChUHOA949l15+f4w6FO7ki+oNXf7Itf+fuGvtifVOF+RH1yj7G TZEpd7G8f2vRQPVXqfFdoZqimjHVgAIegcF1j88oHX5Hvmp2NN16ke2hvg+zoHxOGcc9 dMSRJEsASuaf9Es5CsAVQg7mjiBhT1LTYfFNk7PjNRlLw+R2/C69qXp7Nv3v9QLJOEaA ASAX4uESIITcpxvQRGnLceR/QWJnA5szq9d9ZS2MYV8nUwu5yRlzi5ypNEhNsle0xU5k ZheWRB8iURQ+qpHZ45cnRlQ3H+P3DLMkKdsV6OWHjVcTbkLD+pRRldtsRKHxAP6KeIKo ckWQ== X-Gm-Message-State: AOAM530e4eE6xMpRluZPKv6CRtp3GBDxqotKjfKLTLXaGY2HoHx1fL9F ZtxbqvbvloEKkl7QkHW59093IYtS X-Google-Smtp-Source: ABdhPJzg483RNu+4nzA8/8Jfc8+5o+u6zpPrJV0QEv0nJfXgLJB22HueoeqM1X4AORp+OELgz4VzCw== X-Received: by 2002:a05:620a:573:: with SMTP id p19mr19137295qkp.197.1596905675642; Sat, 08 Aug 2020 09:54:35 -0700 (PDT) Received: from [10.0.10.8] (cpe-65-25-51-0.neo.res.rr.com. [65.25.51.0]) by smtp.googlemail.com with ESMTPSA id d46sm11654516qtk.37.2020.08.08.09.54.34 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 08 Aug 2020 09:54:35 -0700 (PDT) Message-ID: <5F2ED8CA.3070201@gmail.com> Date: Sat, 08 Aug 2020 12:54:34 -0400 From: Ernie Luzar User-Agent: Thunderbird 2.0.0.24 (Windows/20100228) MIME-Version: 1.0 To: Polytropon CC: freebsd-questions@freebsd.org Subject: Re: Best way to make a machine boot with or without a Internet connection References: <20200807211945.ba8fe409.freebsd@edvax.de> <20200808054023.555f71ae@scorpio.seibercom.net> <20200808182528.371dbadf.freebsd@edvax.de> In-Reply-To: <20200808182528.371dbadf.freebsd@edvax.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4BP7cY0btdz48J8 X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=IZo0C7HP; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of luzar722@gmail.com designates 2607:f8b0:4864:20::736 as permitted sender) smtp.mailfrom=luzar722@gmail.com X-Spamd-Result: default: False [-3.84 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; FREEMAIL_FROM(0.00)[gmail.com]; R_SPF_ALLOW(-0.20)[+ip6:2607:f8b0:4000::/36]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; NEURAL_HAM_SHORT(-0.71)[-0.706]; RECEIVED_SPAMHAUS_PBL(0.00)[65.25.51.0:received]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US]; MID_RHS_MATCH_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.10)[-1.102]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; NEURAL_HAM_LONG(-1.04)[-1.036]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[2607:f8b0:4864:20::736:from]; 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 16:54:38 -0000 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?