Setting in FreeBSD 11.1 /etc/rc.conf getting reset

December 11, 2017 1.3k views
Configuration Management FreeBSD

I have been having an issue where my settings in the /etc/rc.conf file are getting reset. Namely my ip configurations are being blanked out. When that happens and I reboot, I have no connectivity and must restore through the console. I then restore the rc.conf from backup. But then it blanks out again.

The file currently contains:

hostname=""

# DigitalOcean Dynamic Configuration lines and the immediate line below it,
# are removed each boot. Hostname is set each boot.

# DigitalOcean Dynamic Configuration
defaultrouter=""
# DigitalOcean Dynamic Configuration
ifconfig_vtnet0="inet  netmask "
# DigitalOcean Dynamic Configuration
ifconfig_vtnet0_alias0="inet  netmask "
# DigitalOcean Dynamic Configuration
ifconfig_vtnet1="inet  netmask "
# DigitalOcean Dynamic Configuration
ifconfig_vtnet0_ipv6="inet6  prefixlen "
# DigitalOcean Dynamic Configuration
ipv6_defaultrouter=""
# DigitalOcean Dynamic Configuration
ipv6_activate_all_interfaces="yes"

I have considered making the rc.conf file read only, but I'd rather fix the root problem. Anyone have any insights?

1 Answer

Take a look at:

/usr/local/etc/rc.d/digitalocean

On boot up, this script sets the network information based on your droplet's configuration. If you want to keep the network settings static, this script can be removed.

  • This lead me to the root cause - /usr/local/bin/jq was missing, which is used to parse the network data for your droplet.

Have another answer? Share your knowledge.