diskimage-builder/elements/dhcp-all-interfaces/install.d/dhcp-all-interfaces.service
Dan Prince 7511faa2b1 Implement dhcp-all-interfaces for systemd.
Includes:

 * Enhancements to the generate-interfaces-file.sh script
 so that it generates ifcfg network-scripts for
 distros like Fedora/RHEL.

 * Includes a new dhcp-all-interfaces.service systemd
 script which ensures network interfaces get generated
 before the network service starts on Fedora.

 * Add a new disable_interface function to
 generate-interfaces-file.sh which (on Fedora)
 will delete the ifcfg config for an interface which
 isn't plugged in.
 This is important because ifcfg-eth0 exists by default
 and we want to remove it if the NIC isn't connected.
 Previous behaviour on Ubuntu is unchanged and the
 generate-interfaces-file.sh just logs it as skipped.

 * General doc updates...

I tested this on a multi-nic machine w/ Fedora where the first NIC
exists but was not connected.

Change-Id: Ia99e312539da43caefd72aa60398d43dac5dcc8f
Closes-Bug: 1239880
2014-01-10 10:14:07 -05:00

15 lines
340 B
Desktop File

[Unit]
Description=DHCP All Interfaces Service
Wants=local-fs.target systemd-udev-settle.service
After=local-fs.target systemd-udev-settle.service
Before=network.service
[Service]
Type=oneshot
ExecStart=/usr/local/sbin/generate-interfaces-file.sh
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
Alias=dhcp-all-interfaces.service