From owner-svn-src-stable@freebsd.org Thu May 30 15:17:36 2019 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E8E2A15C5317; Thu, 30 May 2019 15:17:35 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 909A98FB94; Thu, 30 May 2019 15:17:35 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 828DB1ADB4; Thu, 30 May 2019 15:17:35 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x4UFHZrV025451; Thu, 30 May 2019 15:17:35 GMT (envelope-from markj@FreeBSD.org) Received: (from markj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x4UFHZjD025450; Thu, 30 May 2019 15:17:35 GMT (envelope-from markj@FreeBSD.org) Message-Id: <201905301517.x4UFHZjD025450@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: markj set sender to markj@FreeBSD.org using -f From: Mark Johnston Date: Thu, 30 May 2019 15:17:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org Subject: svn commit: r348427 - stable/12/sbin/dumpon X-SVN-Group: stable-12 X-SVN-Commit-Author: markj X-SVN-Commit-Paths: stable/12/sbin/dumpon X-SVN-Commit-Revision: 348427 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 909A98FB94 X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-2.98 / 15.00]; local_wl_from(0.00)[FreeBSD.org]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.985,0]; ASN(0.00)[asn:11403, ipnet:2610:1c1:1::/48, country:US] X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2019 15:17:36 -0000 Author: markj Date: Thu May 30 15:17:35 2019 New Revision: 348427 URL: https://svnweb.freebsd.org/changeset/base/348427 Log: MFC r348082: Provide an example of using dhclient-script(5) to configure netdump. Modified: stable/12/sbin/dumpon/dumpon.8 Directory Properties: stable/12/ (props changed) Modified: stable/12/sbin/dumpon/dumpon.8 ============================================================================== --- stable/12/sbin/dumpon/dumpon.8 Thu May 30 15:15:47 2019 (r348426) +++ stable/12/sbin/dumpon/dumpon.8 Thu May 30 15:17:35 2019 (r348427) @@ -28,7 +28,7 @@ .\" From: @(#)swapon.8 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd November 17, 2018 +.Dd May 21, 2019 .Dt DUMPON 8 .Os .Sh NAME @@ -283,6 +283,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 ,