diff --git a/elements/dhcp-all-interfaces/README.rst b/elements/dhcp-all-interfaces/README.rst index dd7a3f8c..7ecd387c 100644 --- a/elements/dhcp-all-interfaces/README.rst +++ b/elements/dhcp-all-interfaces/README.rst @@ -17,3 +17,13 @@ configured properly before networking services are started. On Gentoo based distributions we will install the dhcpcd package and ensure the service starts at boot. This service automatically sets up all interfaces found via dhcp and/or dhcpv6 (or SLAAC). + +Environment Variables +--------------------- + +DIB_DHCP_TIMEOUT + :Required: No + :Default: 30 + :Description: Amount of time in seconds that the systemd service will + wait to get an address. + :Example: DIB_DHCP_TIMEOUT=300 diff --git a/elements/dhcp-all-interfaces/install.d/50-dhcp-all-interfaces b/elements/dhcp-all-interfaces/install.d/50-dhcp-all-interfaces index 972645a7..fa7e2fd7 100755 --- a/elements/dhcp-all-interfaces/install.d/50-dhcp-all-interfaces +++ b/elements/dhcp-all-interfaces/install.d/50-dhcp-all-interfaces @@ -24,6 +24,7 @@ if [ "$DIB_INIT_SYSTEM" == "upstart" ]; then elif [ "$DIB_INIT_SYSTEM" == "systemd" ]; then install -D -g root -o root -m 0644 ${SCRIPTDIR}/dhcp-interface@.service /usr/lib/systemd/system/dhcp-interface@.service install -D -g root -o root -m 0644 ${SCRIPTDIR}/dhcp-all-interfaces-udev.rules /etc/udev/rules.d/99-dhcp-all-interfaces.rules + sed -i "s/TimeoutStartSec=DIB_DHCP_TIMEOUT/TimeoutStartSec=${DIB_DHCP_TIMEOUT:-30}s/" /usr/lib/systemd/system/dhcp-interface@.service elif [ "$DIB_INIT_SYSTEM" == "sysv" ]; then install -D -g root -o root -m 0755 ${SCRIPTDIR}/dhcp-all-interfaces.init /etc/init.d/dhcp-all-interfaces update-rc.d dhcp-all-interfaces defaults diff --git a/elements/dhcp-all-interfaces/install.d/dhcp-interface@.service b/elements/dhcp-all-interfaces/install.d/dhcp-interface@.service index 903026e9..c22594d5 100644 --- a/elements/dhcp-all-interfaces/install.d/dhcp-interface@.service +++ b/elements/dhcp-all-interfaces/install.d/dhcp-interface@.service @@ -15,7 +15,7 @@ User=root ExecStartPre=/usr/local/sbin/dhcp-all-interfaces.sh %I ExecStart=/sbin/ifup %I RemainAfterExit=true -TimeoutStartSec=30s +TimeoutStartSec=DIB_DHCP_TIMEOUT [Install] WantedBy=multi-user.target