dhcp-all-interfaces: support Centos/RHEL 6
On Centos and RHEL 6 the init system is upsart but but networking is using sysv compatabiliy and a code path the handle this situation. We can't use DISTRO_NAME because the centos-minimal element sets it to centos for CentOS 7 but the centos element sets it to centos for CentOS 6. Change-Id: Ib8e33ed78b3d6a5737eb7449bccef2d33f72b131 Closes-Bug: #1638527
This commit is contained in:
parent
db4a88642e
commit
d5225055ef
@ -15,7 +15,13 @@ fi
|
||||
|
||||
DIB_INIT_SYSTEM=$(dib-init-system)
|
||||
if [ "$DIB_INIT_SYSTEM" == "upstart" ]; then
|
||||
if [ -e "/etc/redhat-release" ] ; then
|
||||
# the init system is upstart but networking is using sysv compatabiliy (i.e. Centos/RHEL 6)
|
||||
install -D -g root -o root -m 0755 ${SCRIPTDIR}/dhcp-all-interfaces.init /etc/init.d/dhcp-all-interfaces
|
||||
chkconfig dhcp-all-interfaces on
|
||||
else
|
||||
install -D -g root -o root -m 0755 ${SCRIPTDIR}/dhcp-all-interfaces.conf /etc/init/dhcp-all-interfaces.conf
|
||||
fi
|
||||
elif [ "$DIB_INIT_SYSTEM" == "systemd" ]; then
|
||||
install -D -g root -o root -m 0755 ${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
|
||||
|
@ -6,6 +6,7 @@
|
||||
# Default-Start: S
|
||||
# Default-Stop: 0 6
|
||||
# X-Start-Before: networking
|
||||
# chkconfig: 3 9 50
|
||||
# Short-Description: Autodetect network interfaces
|
||||
# Description: Autodetect network interfaces during boot and configure them for DHCP
|
||||
### END INIT INFO
|
||||
|
Loading…
Reference in New Issue
Block a user