Date: Tue, 14 May 2002 18:36:52 +0100 From: Nuno Teixeira <nunotex@pt-quorum.com> To: freebsd-stable@freebsd.org Subject: enable/disable softupdates in rc init idea Message-ID: <20020514173651.GA284@gw.tex.bogus>
next in thread | raw e-mail | index | archive | help
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 <filesystem> tunefs -n enable <filesystem> mount -ufo rw <filesystem> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020514173651.GA284>