From owner-freebsd-current Mon Dec 9 11:19:54 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5E56537B401 for ; Mon, 9 Dec 2002 11:19:50 -0800 (PST) Received: from odin.ac.hmc.edu (Odin.AC.HMC.Edu [134.173.32.75]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3123043EB2 for ; Mon, 9 Dec 2002 11:19:49 -0800 (PST) (envelope-from brdavis@odin.ac.hmc.edu) Received: from odin.ac.hmc.edu (IDENT:brdavis@localhost.localdomain [127.0.0.1]) by odin.ac.hmc.edu (8.12.3/8.12.3) with ESMTP id gB9JJSen018068; Mon, 9 Dec 2002 11:19:28 -0800 Received: (from brdavis@localhost) by odin.ac.hmc.edu (8.12.3/8.12.3/Submit) id gB9JJDaN018001; Mon, 9 Dec 2002 11:19:13 -0800 Date: Mon, 9 Dec 2002 11:19:13 -0800 From: Brooks Davis To: Kirk McKusick Cc: Brooks Davis , Nate Lawson , Archie Cobbs , freebsd-current@FreeBSD.ORG Subject: Re: backgroud fsck is still locking up system (fwd) Message-ID: <20021209111913.A11284@Odin.AC.HMC.Edu> References: <20021206104445.A1950@Odin.AC.HMC.Edu> <200212070152.gB71qc59094441@beastie.mckusick.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-md5; protocol="application/pgp-signature"; boundary="7JfCtLOvnd9MIVvH" Content-Disposition: inline User-Agent: Mutt/1.2.5.1i In-Reply-To: <200212070152.gB71qc59094441@beastie.mckusick.com>; from mckusick@beastie.mckusick.com on Fri, Dec 06, 2002 at 05:52:38PM -0800 X-Virus-Scanned: by amavisd-milter (http://amavis.org/) on odin.ac.hmc.edu Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --7JfCtLOvnd9MIVvH Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Dec 06, 2002 at 05:52:38PM -0800, Kirk McKusick wrote: > Adding a two minute delay before starting background fsck > sounds like a very good idea to me. Please send me your > suggested change. Here it is. As written it doesn't add the delay, but you can change etc/defaults/rc.conf to do that it desired. -- Brooks --=20 Any statement of the form "X is the one, true Y" is FALSE. PGP fingerprint 655D 519C 26A7 82E7 2529 9BF0 5D8E 8BE9 F238 1AD4 Index: etc/rc =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /usr/cvs/src/etc/rc,v retrieving revision 1.323 diff -u -p -r1.323 rc --- etc/rc 26 Nov 2002 17:51:03 -0000 1.323 +++ etc/rc 4 Dec 2002 23:08:41 -0000 @@ -982,8 +982,14 @@ esac # Start background fsck checks if necessary case ${background_fsck} in [Yy][Ee][Ss]) - echo 'Starting background filesystem checks' - nice -4 fsck -B -p 2>&1 | logger -p daemon.notice & + bgfsck_msg=3D'Starting background file system checks' + if [ ${background_fsck_delay:=3D0} -gt 0 ]; then + bgfsck_msg=3D"${bgfsck_msg} in ${background_fsck_delay} seconds" + fi + echo "${bgfsck_msg}." + + (sleep ${background_fsck_delay}; nice -4 fsck -B -p) 2>&1 | \ + logger -p daemon.notice & ;; esac =20 Index: etc/defaults/rc.conf =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /usr/cvs/src/etc/defaults/rc.conf,v retrieving revision 1.164 diff -u -p -r1.164 rc.conf --- etc/defaults/rc.conf 6 Dec 2002 05:23:37 -0000 1.164 +++ etc/defaults/rc.conf 6 Dec 2002 18:02:18 -0000 @@ -40,6 +40,7 @@ script_name_sep=3D" " # Change if your sta rc_conf_files=3D"/etc/rc.conf /etc/rc.conf.local" fsck_y_enable=3D"NO" # Set to YES to do fsck -y if the initial preen fails. background_fsck=3D"YES" # Attempt to run fsck in the background where poss= ible. +background_fsck_delay=3D"0" # Time to wait (seconds) before starting the f= sck. extra_netfs_types=3D"NO" # List of network extra filesystem types for dela= yed # mount at startup (or NO). =20 Index: etc/rc.d/bgfsck =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /usr/cvs/src/etc/rc.d/bgfsck,v retrieving revision 1.2 diff -u -p -r1.2 bgfsck --- etc/rc.d/bgfsck 28 Jul 2002 03:38:10 -0000 1.2 +++ etc/rc.d/bgfsck 9 Oct 2002 23:31:45 -0000 @@ -11,9 +11,20 @@ =20 name=3D"background-fsck" rcvar=3D"background_fsck" -start_precmd=3D"echo 'Starting background file system checks.'" -start_cmd=3D"nice -4 fsck -B -p 2>&1 | logger -p daemon.notice &" +start_cmd=3D"bgfsck_start" stop_cmd=3D":" + +bgfsck_start () +{ + bgfsck_msg=3D'Starting background file system checks' + if [ ${background_fsck_delay:=3D0} -gt 0 ]; then + bgfsck_msg=3D"${bgfsck_msg} in ${background_fsck_delay} seconds" + fi + echo "${bgfsck_msg}." + + (sleep ${background_fsck_delay}; nice -4 fsck -B -p) 2>&1 | \ + logger -p daemon.notice & +} =20 load_rc_config $name run_rc_command "$1" Index: share/man/man5/rc.conf.5 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /usr/cvs/src/share/man/man5/rc.conf.5,v retrieving revision 1.166 diff -u -p -r1.166 rc.conf.5 --- share/man/man5/rc.conf.5 29 Nov 2002 11:39:19 -0000 1.166 +++ share/man/man5/rc.conf.5 4 Dec 2002 23:11:53 -0000 @@ -734,6 +734,11 @@ If set to the system will attempt to run .Xr fsck 8 in the background where possible. +.It Va background_fsck_delay +.Pq Vt int +The amount of time in seconds to sleep before starting a background fsck. +Setting this to a non-zero number may allow large applications such as +the X server to start before disk I/O bandwidth is monopolized by fsck. .It Va extra_netfs_types .Pq Vt str If set to something other than --7JfCtLOvnd9MIVvH Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: For info see http://www.gnupg.org iD8DBQE99OyuXY6L6fI4GtQRAqa/AJ9PGOtayJitWq2D+cxQ2/HqU/LvMQCbBwCn ATCIAX+bIie1LYnYqxpjDtk= =gwyo -----END PGP SIGNATURE----- --7JfCtLOvnd9MIVvH-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message