title: Why would /etc/network/interfaces be empty after programmatic changes and subsequent reboot?
body: <p>I run a node.js server on an embedded device which provides a web UI to allow users to modify network interface settings - for example, changing from Static to DHCP or vice versa, or setting specific Static IP settings (netmask, gatetway), etc. With these user-driven configuration parameters, I am able to programmatically generate a new /etc/network/interfaces file (of course, after backing the previous file to /etc/network/interfaces.bak file). I even do a 'cat /etc/network/interfaces' to the log file of the new configuration file to confirm the new interfaces file's contents and syntactic validity. So far, everything is hunky-dory.</p>
  
  <p>However, if there is a reboot on my device (with or without a /etc/init.d/networking stop/start prior to reboot), I find that many times the system comes up with an empty /etc/network/interfaces file and, therefore, no network interfaces. (Fortunately, I have a JTAG interface allowing SSH connection and so still have connection to my device but to users their device is essentially bricked.)</p>
  
  <p>What would cause the OS to blank the /etc/network/interfaces file? I think this must be done during system initialization - but for what reason?</p>
  
  <p>If I make the same changes manually using a text editor and reboot, everything is fine - the new interface settings come up every time.</p>
  
  <p>I am at a loss to explain what might be causing this behavior.</p>
  
  <p>--</p>
  
  <p>Here are other factors that I considered but have ruled out:</p>
  
  <ul>
  <li>Perhaps the file isn't saved properly? I've ruled this out because
  the cat command would indicate it was successfully saved.</li>
  <li>Perhaps there are other files (or persistent settings) that need to be modified, without which the configuration is considered invalid and blanked? I've ruled this out because my understanding is that the interfaces file is the only configuration required for interface setup.</li>
  <li>Perhaps there are syntatic errors in the interfaces file. I've ruled
  this out because I've compared my programmatic output to valid files
  and things look fine. Furthermore, I don't think syntatic errors
  would cause a file to be blanked.</li>
  </ul>
  
  <p>EDIT: My device is based on a TI Sitara uP running a Debian Wheezy 3.14 variant. I run node.js v0.12.x as the server backend.</p>