Date: Sat, 8 Aug 2020 05:40:23 -0400 From: Jerry <jerry@seibercom.net> To: "User Questions" <freebsd-questions@freebsd.org> 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: <CAGBxaXnaokaYSPQFK%2BWg6Ym3BxD=nin%2BMha21G8FbfcsCTuVYw@mail.gmail.com> <CA%2ByoEx_wrT-D6H7DxqWzHNciHZAaLmbPs%2Bny52f8JZrum_LgkQ@mail.gmail.com> <CAGBxaX=0-C29=pJnVbJOWefzWzquhbfLfMtfdfBSKjh569weFA@mail.gmail.com> <20200807211945.ba8fe409.freebsd@edvax.de>
next in thread | previous in thread | raw e-mail | index | archive | help
--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 <lobo@bsd.com.br> wrote: >> =20 >> > On Thu, Aug 6, 2020 at 6:20 PM Aryeh Friedman >> > <aryeh.friedman@gmail.com> 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--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20200808054023.555f71ae>