aboutsummaryrefslogtreecommitdiff
path: root/sbin/dumpon
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2019-05-22 03:49:38 +0000
committerMark Johnston <markj@FreeBSD.org>2019-05-22 03:49:38 +0000
commit73cc16949ae35fe24b67918b0630f2fd0d4c830c (patch)
tree1860ad58a496fe000c5b8c61309c62049859f139 /sbin/dumpon
parentf0e2814d3452c5e4c66e55881c2cfeea6bd81eb5 (diff)
downloadsrc-73cc16949ae35fe24b67918b0630f2fd0d4c830c.tar.gz
src-73cc16949ae35fe24b67918b0630f2fd0d4c830c.zip
Provide an example of using dhclient-script(5) to configure netdump.
Reviewed by: cem MFC after: 1 week Event: Waterloo Hackathon 2019 Differential Revision: https://reviews.freebsd.org/D20345
Notes
Notes: svn path=/head/; revision=348082
Diffstat (limited to 'sbin/dumpon')
-rw-r--r--sbin/dumpon/dumpon.845
1 files changed, 44 insertions, 1 deletions
diff --git a/sbin/dumpon/dumpon.8 b/sbin/dumpon/dumpon.8
index a62bd366dfb4..d5f45d4e03ff 100644
--- a/sbin/dumpon/dumpon.8
+++ b/sbin/dumpon/dumpon.8
@@ -28,7 +28,7 @@
.\" From: @(#)swapon.8 8.1 (Berkeley) 6/5/93
.\" $FreeBSD$
.\"
-.Dd May 6, 2019
+.Dd May 21, 2019
.Dt DUMPON 8
.Os
.Sh NAME
@@ -317,6 +317,49 @@ Note that the live kernel might be at a different path
which can be examined by looking at the
.Va kern.bootfile
.Xr sysctl 8 .
+.Pp
+The
+.Nm
+.Xr rc 8
+script runs early during boot, typically before networking is configured.
+This makes it unsuitable for configuring
+.Xr netdump
+when the client address is dynamic.
+To configure
+.Xr netdump
+when
+.Xr dhclient
+binds to a server,
+.Xr dhclient-script
+can be used to run
+.Xr dumpon .
+For example, to automatically configure
+.Xr netdump
+on the vtnet0 interface, add the following to
+.Pa /etc/dhclient-exit-hooks .
+.Bd -literal
+case $reason in
+BOUND|REBIND|REBOOT|RENEW)
+ if [ "$interface" != vtnet0 ] || [ -n "$old_ip_address" -a \\
+ "$old_ip_address" = "$new_ip_address" ]; then
+ break
+ fi
+ if [ -n "$new_routers" ]; then
+ # Take the first router in the list.
+ gateway_flag="-g ${new_routers%% *}"
+ fi
+ dumpon -c $new_ip_address -s $server $gateway_flag vtnet0
+ ;;
+esac
+.Ed
+.Pp
+Be sure to fill in the server IP address and change the interface name if
+needed, and to configure
+.Pp
+.Dl dumpdev="NO"
+.Pp
+in
+.Pa /etc/rc.conf .
.Sh SEE ALSO
.Xr gzip 1 ,
.Xr kgdb 1 ,