From owner-freebsd-bugs Tue Oct 10 22:10: 7 2000 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 563C337B502 for ; Tue, 10 Oct 2000 22:10:01 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id WAA81453; Tue, 10 Oct 2000 22:10:01 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from belle.rnoc.urc.ac.ru (belle.rnoc.urc.ac.ru [193.233.85.10]) by hub.freebsd.org (Postfix) with ESMTP id 1A2BA37B66D for ; Tue, 10 Oct 2000 22:00:06 -0700 (PDT) Received: (from anton@localhost) by belle.rnoc.urc.ac.ru (8.11.0/8.9.3) id e9B4xJG82752; Wed, 11 Oct 2000 10:59:19 +0600 (YEKST) (envelope-from anton) Message-Id: <200010110459.e9B4xJG82752@belle.rnoc.urc.ac.ru> Date: Wed, 11 Oct 2000 10:59:19 +0600 (YEKST) From: anton@urc.ac.ru Reply-To: anton@urc.ac.ru To: FreeBSD-gnats-submit@freebsd.org X-Send-Pr-Version: 3.2 Subject: misc/21904: Fix for diskless startup bug in /etc/rc Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org >Number: 21904 >Category: misc >Synopsis: Fix for diskless startup bug in /etc/rc >Confidential: no >Severity: serious >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Oct 10 22:10:01 PDT 2000 >Closed-Date: >Last-Modified: >Originator: Anton Voronin >Release: FreeBSD 4.1-STABLE i386 >Organization: Southern Ural State University, Chelyabinsk, Russia >Environment: i386 workstations boot FreeBSD 4.1-STABLE remotely from the server with the same OS using rc.diskless* scripts. / and /usr are monted from the server (actually the server's / and /usr), /etc and /var are mounted by rc.diskless2. /tmp and swap are mounted from local disks. >Description: /etc/rc checks $1 against "autoboot" after it runs /etc/rc.diskless1. But as the latter uses "set" command, it clears the command line, and so /etc/rc fails to check for autoboot mode, so it doesn't run fsck, and so fails to mount local filesystems (/tmp in my case). >How-To-Repeat: Ensure you have /etc/rc.diskless* on the file server, boot FreeBSD 4.1-STABLE remotely from this server, and specify some locally mounted filesystems in /etc/fstab (ensure you have "1" in the 6th column for these filesystems. Then do a "dirty" reboot of the remote-booting machine (with reset button), and watch the booting process: instead of running fsck it prints "Skipping disk checks...", and then fails to mount local filesystems because they are still not clean. >Fix: --- rc.old Fri Sep 8 12:16:20 2000 +++ rc Wed Oct 11 10:34:09 2000 @@ -20,6 +20,7 @@ trap : 2 trap : 3 # shouldn't be needed +bootmode=$1 HOME=/ PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin export HOME PATH @@ -57,7 +58,7 @@ swapon -a -case $1 in +case ${bootmode} in autoboot) echo Automatic boot in progress... fsck -p >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message