Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 7 Aug 2020 21:19:45 +0200
From:      Polytropon <freebsd@edvax.de>
To:        Aryeh Friedman <aryeh.friedman@gmail.com>
Cc:        Mario Lobo <lobo@bsd.com.br>, FreeBSD Mailing List <freebsd-questions@freebsd.org>
Subject:   Re: Best way to make a machine boot with or without a Internet connection
Message-ID:  <20200807211945.ba8fe409.freebsd@edvax.de>
In-Reply-To: <CAGBxaX=0-C29=pJnVbJOWefzWzquhbfLfMtfdfBSKjh569weFA@mail.gmail.com>
References:  <CAGBxaXnaokaYSPQFK%2BWg6Ym3BxD=nin%2BMha21G8FbfcsCTuVYw@mail.gmail.com> <CA%2ByoEx_wrT-D6H7DxqWzHNciHZAaLmbPs%2Bny52f8JZrum_LgkQ@mail.gmail.com> <CAGBxaX=0-C29=pJnVbJOWefzWzquhbfLfMtfdfBSKjh569weFA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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:
> 
> > On Thu, Aug 6, 2020 at 6:20 PM Aryeh Friedman <aryeh.friedman@gmail.com>
> > 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... ;-)



-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20200807211945.ba8fe409.freebsd>