rc(8) script -- waiting for the network to become usable

Julian Elischer julian at elischer.org
Mon Apr 26 16:26:21 UTC 2010


On 4/26/10 1:08 AM, Jeremy Chadwick wrote:
> Foremost, sorry for the cross-post, but more eyes in this case means
> overall more discussion.  Secondly, please keep me CC'd as I'm not on
> either -rc or -net.
>
> I recently proposed addition of a new script to the rc framework which
> verifies (using ping) that layer 3 network connectivity is up/functional
> before continuing on with daemons which require network access:

a down side is that you can't boot if some OTHER machine is not up.

>
> http://lists.freebsd.org/pipermail/freebsd-stable/2010-April/056400.html
>
> The overall response was positive, with full acknowledgement that this
> is indeed a hack -- yet necessary -- and that something more appropriate
> could probably be introduced into the base system to provide a much
> cleaner solution (launchd was mentioned).

there does need to be some dependency tracking to do with networks.
maybe there acn be a selection of ways to pass that milestone..

(carrier detect, ping, incoming packets non-0) etc.
my favourite is:

INPUT_PACKETS=`netstat -i | awk "/${IP}/"'{print $5}'`
if [ -n "${INPUT_PACKETS}" -a "${INPUT_PACKETS}" != "0" ]
them
     echo  "It's UP!"
fi


>
> I'd like folks (particularly on -rc) to chime in here, and please see
> about adding this to the base system.
>
> Please note there's one typo in the script (a line which needs to be
> commented out) in my original post which I've since fixed in the version
> that's available via HTTP.
>
> Thank you!
>



More information about the freebsd-rc mailing list