Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 8 Aug 2020 19:05:45 +0200
From:      Polytropon <freebsd@edvax.de>
To:        Ernie Luzar <luzar722@gmail.com>
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:  <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> <20200808054023.555f71ae@scorpio.seibercom.net> <20200808182528.371dbadf.freebsd@edvax.de> <5F2ED8CA.3070201@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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 <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... ;-)
> >> 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, ...



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