title: system() call not working with ifup/ifdown
body: <p>I am writing a C++ system supervision daemon for an embedded device running debian jessie. This daemon process needs to be able to reconfigure network devices. The daemon runs as root user and uses the calls system( "ifdown --force -v eth0" ) and system( "ifup --force -v eth0" ) to read in the changed interface definition. When I type these commands as root user in a shell I get the following output:</p>
  
  <pre><code>root@mds:/etc/network/interfaces.d# ifdown --force -v eth0
  Reading directory /etc/network/interfaces.d
  Parsing file /etc/network/interfaces.d/eth0
  Parsing file /etc/network/interfaces.d/eth1
  Parsing file /etc/network/interfaces.d/eth2
  Configuring interface eth0=eth0 (inet)
  run-parts --verbose /etc/network/if-down.d
  run-parts: executing /etc/network/if-down.d/upstart
  run-parts: executing /etc/network/if-down.d/wpasupplicant
  
  ip -4 addr flush dev eth0 label eth0
  ip link set dev eth0 down
  run-parts --verbose /etc/network/if-post-down.d
  run-parts: executing /etc/network/if-post-down.d/wpasupplicant
  
  root@mds:/etc/network/interfaces.d# ifup --force -v eth0
  Reading directory /etc/network/interfaces.d
  Parsing file /etc/network/interfaces.d/eth0
  Parsing file /etc/network/interfaces.d/eth1
  Parsing file /etc/network/interfaces.d/eth2
  Configuring interface eth0=eth0 (inet)
  run-parts --exit-on-error --verbose /etc/network/if-pre-up.d
  run-parts: executing /etc/network/if-pre-up.d/wpasupplicant
  ip addr add 192.168.1.1/255.255.255.0 broadcast 192.168.1.255    dev eth0 label eth0
  ip link set dev eth0   up
  
  run-parts --exit-on-error --verbose /etc/network/if-up.d
  run-parts: executing /etc/network/if-up.d/mountnfs
  run-parts: executing /etc/network/if-up.d/openssh-server
  run-parts: executing /etc/network/if-up.d/upstart
  run-parts: executing /etc/network/if-up.d/wpasupplicant
  </code></pre>
  
  <p>But when I execute the same commands through the system() call in my daemon running in the same shell I only get this:</p>
  
  <pre><code>2017-07-10 17:25:16.591 +02:msg:MDSSV:15: executing ifdown command: ifdown --force -v eth0
  Reading directory /etc/network/interfaces.d
  Parsing file /etc/network/interfaces.d/eth0
  Parsing file /etc/network/interfaces.d/eth1
  Parsing file /etc/network/interfaces.d/eth2
  2017-07-10 17:25:17.596 +02:msg:MDSSV:15: executing ifup command: ifup --force -v eth0
  Reading directory /etc/network/interfaces.d
  Parsing file /etc/network/interfaces.d/eth0
  Parsing file /etc/network/interfaces.d/eth1
  Parsing file /etc/network/interfaces.d/eth2
  </code></pre>
  
  <p>The eth0 device remains unchanged. It looks like ifup/ifdown read only the device configurations but do not do anything else. Why are ifup/ifdown behaving different when called through system()?</p>