From owner-freebsd-bugs Sun Aug 25 18:40:05 1996 Return-Path: owner-bugs Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id SAA06669 for bugs-outgoing; Sun, 25 Aug 1996 18:40:05 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id SAA06656; Sun, 25 Aug 1996 18:40:03 -0700 (PDT) Resent-Date: Sun, 25 Aug 1996 18:40:03 -0700 (PDT) Resent-Message-Id: <199608260140.SAA06656@freefall.freebsd.org> Resent-From: gnats (GNATS Management) Resent-To: freebsd-bugs Resent-Reply-To: FreeBSD-gnats@freefall.FreeBSD.org, leonard@dstc.edu.au Received: from trapdoor.dstc.edu.au (root@trapdoor.dstc.edu.au [130.102.176.12]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id SAA06129 for ; Sun, 25 Aug 1996 18:36:17 -0700 (PDT) Received: from scry.dstc.edu.au (scry.dstc.edu.au [130.102.176.222]) by trapdoor.dstc.edu.au (8.6.9/8.6.12) with ESMTP id LAA05035; Mon, 26 Aug 1996 11:36:12 +1000 Received: (from d@localhost) by scry.dstc.edu.au (8.7.5/8.6.12) id LAA00617; Mon, 26 Aug 1996 11:36:12 +1000 (EST) Message-Id: <199608260136.LAA00617@scry.dstc.edu.au> Date: Mon, 26 Aug 1996 11:36:12 +1000 (EST) From: David Leonard Reply-To: leonard@dstc.edu.au To: FreeBSD-gnats-submit@freebsd.org Cc: leonard@dstc.edu.au X-Send-Pr-Version: 3.2 Subject: bin/1542: swapon -a ignores 'noauto' tags in /etc/fstab Sender: owner-bugs@freebsd.org X-Loop: FreeBSD.org Precedence: bulk >Number: 1542 >Category: bin >Synopsis: swapon -a ignores 'noauto' tags in /etc/fstab >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sun Aug 25 18:40:01 PDT 1996 >Last-Modified: >Originator: David Leonard >Organization: DSTC, Brisbane, Australia +61 7 3365 4310 >Release: FreeBSD 2.2-CURRENT i386 >Environment: FreeBSD scry.dstc.edu.au 2.2-CURRENT FreeBSD 2.2-CURRENT #0: Fri Aug 16 13:25:02 EST 1996 d@scry.dstc.edu.au:/u1/src/sys/compile/SCRY i386 >Description: swapon -a ignores the 'noauto' tag in /etc/fstab. This (I feel) is inconsistent with the -a option to mount. Since they both read from the same file (/etc/fstab) I would have thought they both honoured the noauto `option'! >How-To-Repeat: In /etc/fstab: /dev/wd0s2b none swap sw 0 0 /dev/wd1b none swap sw,noauto 0 0 reboot, and Device 512-blocks Used Avail Capacity Type /dev/wd0s2b 65536 64 65344 0% Interleaved /dev/wd1b 131072 0 130944 0% Interleaved Total 196352 64 196288 0% >Fix: untested diffs follow: cvs server: Diffing . Index: swapon.8 =================================================================== RCS file: /home/leonard/cvsroot/freebsd/src/sbin/swapon/swapon.8,v retrieving revision 1.1.1.1 diff -c -r1.1.1.1 swapon.8 *** swapon.8 1996/08/16 00:12:14 1.1.1.1 --- swapon.8 1996/08/26 01:29:27 *************** *** 61,67 **** All devices marked as ``sw'' swap devices in .Pa /etc/fstab ! are made available. .El .Pp The second form gives individual block devices as given --- 61,67 ---- All devices marked as ``sw'' swap devices in .Pa /etc/fstab ! are made available, unless marked with ``noauto''. .El .Pp The second form gives individual block devices as given Index: swapon.c =================================================================== RCS file: /home/leonard/cvsroot/freebsd/src/sbin/swapon/swapon.c,v retrieving revision 1.1.1.1 diff -c -r1.1.1.1 swapon.c *** swapon.c 1996/08/16 00:12:14 1.1.1.1 --- swapon.c 1996/08/26 01:29:27 *************** *** 76,81 **** --- 76,83 ---- while ((fsp = getfsent()) != NULL) { if (strcmp(fsp->fs_type, FSTAB_SW)) continue; + if (strstr(fsp->fs_mntops, "noauto")) + continue; if (add(fsp->fs_spec, 1)) stat = 1; else >Audit-Trail: >Unformatted: