Personal tools

Contact Us 24/7 > 1 866.SIX FEET
Sections

Skip to content. | Skip to navigation

Home > Blog > Adventures with FreeBSD and Advanced Networking
12/07/16

EVERYONE.NET SCHEDULED MAINTENANCE 

Everyone.net will be performing maintenance on their databases Friday, December 9th, 2016 between 9:00PM PT to 3:00AM PT / 12:00AM ET to 06:00AM ET. During this time, all services including web mail, POP, IMAP, and SMTP relay may experience degraded performance and inbound mail delivery delays. We apologize for any inconvenience.

Blog

Adventures with FreeBSD and Advanced Networking

written by lars on Thursday March 10, 2011

It appears that, if you use some of the more advanced networking technologies built into FreeBSD, it is possible to put yourself into a bit of a pickle. More specifically, if you're running CARP on LAGG (LACP) network interfaces and use iSCSI, it is possible for the server to put itself into a loop at boot that is not recoverable.  As the system comes up, the CARP interface comes up, but is not yet in state MASTER. The boot loader continues. This causes iSCSI to attempt to mount without a network connection, which then moves to MySQL starting without its data store. All in all a sub-optimal situation.

Fortunately a solution presented itself! We wrote a quick and dirty rc.subr script called Liveping. This script starts before the iSCSI Intiator and starts pinging a known service on our network.  Liveping will not exit until it gets a response from a remote machine verifying that networking is in a state ready to use.

### SCRIPT
#!/bin/sh
# PROVIDE:liveping
# REQUIRE: netif routing
# BEFORE: NETWORKING

# Liveping: Stall the boot process until we can either ping the
# host set in rc.conf or the nameserver to be sure we are ready to
# start network services and mount NFS.  Timeout after 60 seconds
# unless specified otherwise.
#
# Add the following line to /etc/rc.conf to enable liveping:
#
#  liveping_enable="YES"
#  # optional
#  liveping_target="192.168.1.1"
#  liveping_timeout="60"
#

detected_nameserver=`sed -n "s/nameserver //p" /etc/resolv.conf`

. "/etc/rc.subr"

# Set some defaults
liveping_enable=${liveping_enable:-"NO"}
liveping_target=${liveping_target:-"$detected_nameserver"}
liveping_timeout=${liveping_timeout:-"60"}

name=liveping
rcvar=`set_rcvar`
load_rc_config $name
command=/sbin/ping
command_args="-o -t ${liveping_timeout} ${liveping_target} > /dev/null 2>&1"

run_rc_command "$1"
### END
This allowed us to bring up the server while guaranteeing MySQL starts with proper iSCSI data store. More information about RC.SUBR available on FreeBSD site
 
Ever experience issues like this?  Do you have alternative options to solve this issue?
 
Add comment

You can add a comment by filling out the form below. Plain text formatting.

puzzle

Next Steps


Select a type of support:

Contact our sales team

First name:
Last name:
Email:
Phone Number:
Message:
Fight spam:
What is + ?
 
Call Us 1 866.SIX FEET
Sections