aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorColin Percival <cperciva@FreeBSD.org>2020-09-28 17:32:18 +0000
committerColin Percival <cperciva@FreeBSD.org>2020-09-28 17:32:18 +0000
commitf614d5fcd6f00605835dd299b07716dfe542368b (patch)
treea92e6552a84041b9bf0d16cb74449d98dc5d691b
parentf0804798daead6e931224ad38422a28768e1db62 (diff)
downloadsrc-f614d5fcd6f00605835dd299b07716dfe542368b.tar.gz
src-f614d5fcd6f00605835dd299b07716dfe542368b.zip
MFS r366028: Spawn the DHCPv6 client in EC2 instances via rtsold.
Approved by: re (gjb) Sponsored by: https://www.patreon.com/cperciva
Notes
Notes: svn path=/releng/12.2/; revision=366232
-rw-r--r--release/tools/ec2.conf16
1 files changed, 13 insertions, 3 deletions
diff --git a/release/tools/ec2.conf b/release/tools/ec2.conf
index 440c69cc95ff..22735e7a3f27 100644
--- a/release/tools/ec2.conf
+++ b/release/tools/ec2.conf
@@ -6,7 +6,7 @@
# Packages to install into the image we're creating. This is a deliberately
# minimalist set, providing only the packages necessary to bootstrap further
# package installation as specified via EC2 user-data.
-export VM_EXTRA_PACKAGES="ec2-scripts firstboot-freebsd-update firstboot-pkgs dual-dhclient-daemon ebsnvme-id"
+export VM_EXTRA_PACKAGES="ec2-scripts firstboot-freebsd-update firstboot-pkgs isc-dhcp44-client ebsnvme-id"
# Include the amazon-ssm-agent package in amd64 images, since some users want
# to be able to use it on systems which are not connected to the Internet.
@@ -63,9 +63,19 @@ vm_extra_pre_umount() {
# via EC2 user-data.
echo 'firstboot_pkgs_list="awscli"' >> ${DESTDIR}/etc/rc.conf
- # Enable IPv6 on all interfaces, and use DHCP on both IPv4 and IPv6.
+ # Enable IPv6 on all interfaces, and spawn DHCPv6 via rtsold
echo 'ipv6_activate_all_interfaces="YES"' >> ${DESTDIR}/etc/rc.conf
- echo 'dhclient_program="/usr/local/sbin/dual-dhclient"' >> ${DESTDIR}/etc/rc.conf
+ echo 'rtsold_enable="YES"' >> ${DESTDIR}/etc/rc.conf
+ echo 'rtsold_flags="-M /usr/local/libexec/rtsold-M -a"' >> ${DESTDIR}/etc/rc.conf
+
+ # Provide a script which rtsold can use to launch DHCPv6
+ mkdir -p ${DESTDIR}/usr/local/libexec
+ cat > ${DESTDIR}/usr/local/libexec/rtsold-M <<'EOF'
+#!/bin/sh
+
+/usr/local/sbin/dhclient -6 -nw -N -cf /dev/null $1
+EOF
+ chmod 755 ${DESTDIR}/usr/local/libexec/rtsold-M
# The EC2 console is output-only, so while printing a backtrace can
# be useful, there's no point dropping into a debugger or waiting