From owner-freebsd-stable Tue May 14 10:38:36 2002 Delivered-To: freebsd-stable@freebsd.org Received: from pt-quorum.com (pt-quorum.com [209.10.167.210]) by hub.freebsd.org (Postfix) with ESMTP id B0CF937B407 for ; Tue, 14 May 2002 10:38:31 -0700 (PDT) Received: from gw.tex.bogus (195-23-212-88.nr.ip.pt [195.23.212.88]) by pt-quorum.com (Postfix) with ESMTP id C083FEC10 for ; Tue, 14 May 2002 18:37:34 +0100 (WEST) Received: by gw.tex.bogus (Postfix, from userid 1001) id 5C3AE24E; Tue, 14 May 2002 18:36:52 +0100 (WEST) Date: Tue, 14 May 2002 18:36:52 +0100 From: Nuno Teixeira To: freebsd-stable@freebsd.org Subject: enable/disable softupdates in rc init idea Message-ID: <20020514173651.GA284@gw.tex.bogus> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.99i X-Operating-System: FreeBSD 4.6-PRERELEASE Sender: owner-freebsd-stable@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Hello to all, I'm looking for a solution to enable/disable softupdates without: 1. using single user mode 2. changing filesystem status, e.g.: mount -ufo ro tunefs -n enable mount -ufo rw 1. is problematic for those who don't have console access to machine/server 2. can result in several errors in filesystems like /var To enable softupdates in a filesystem, we need to have a filesystem unmounted (or in reed-only mode) so I used rc script to enable it before the system mounts all filesystems. I've changed rc (line 217 - 4.6-PRERELEASE) to: ### /etc/rc (...) # If using diskless, run custom disk mounting function here # if [ -n "${diskless_mount}" -a -r "${diskless_mount}" ]; then sh ${diskless_mount} else # otherwise mount everything except nfs filesystems. + #SOFTUPDATES ENABLE/DISABLE BEFORE MOUNTING ALL FILESYSTEMS - + + case ${softupdates_enable} in + [Nn][Oo][Nn][Ee] | '') + # do nothing + ;; + [Yy][Ee][Ss]) + # enable softupdates in fs list + for sufs in ${softupdates_fs}; do + tunefs -n enable ${sufs} + done + ;; + [No][Oo]) + # disable softupdates in fs list + for sufs in ${softupdates_fs}; do + tunefs -n disable ${sufs} + done + ;; + esac mount -a -t nonfs fi (...) and add 2 config lines to rc.conf: ### /etc/rc.conf + softupdates_enable="NONE" # YES - Enable; NO - Disable; NONE - Nothing + softupdates_fs="/dev/ad0s1d /dev/ad0s1h" It works ok but this method is stupid because we need to activate softupdates only once and not every time that we reboot/start the machine. Does anyone knows a better way of doing this? Thanks, Nuno Teixeira -- /* PGP fingerprint: C6D1 06ED EB54 A99C 6B14 6732 0A5D 810D 727D F6C6 */ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-stable" in the body of the message