Date: Tue, 05 Jan 2010 22:49:12 -0800 From: Doug Barton <dougb@FreeBSD.org> To: Rob Farmer <rfarmer@predatorlabs.net> Cc: freebsd-rc@freebsd.org Subject: Re: devfs ruleset processing in rc.subr Message-ID: <4B443268.7040905@FreeBSD.org> In-Reply-To: <b025ceb71001051827p10a5becfo3e24b73a2f570f81@mail.gmail.com> References: <b025ceb71001051827p10a5becfo3e24b73a2f570f81@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Rob Farmer wrote: > Hello, > > I am trying to fix an issue with the port shells/scponly's rc.d script > and I think I may have come across a bug in /etc/rc.subr related to > devfs. > > Here's what I'm trying to do: > > make_devfs() { > # $1 is the user name whose home directory needs a minimal > # devfs created. If ~/dev exists, it will be deleted. > > eval DEV="~$1/dev" > while /sbin/umount "${DEV}" 2>/dev/null; do :; done This definitely shouldn't be set up to spin forever like this ... probably needs to try the umount || err > /bin/rm -rf "${DEV}" Personally I would rather see here: rmdir $DEV || err 1 "Unable to remove $DEV" Although frankly I'm a little confused as to why you go through all these gymnastics, although I do admire your thoroughness. :) What are your goals for all the safety features? > /bin/mkdir -p "${DEV}" > devfs_domount "${DEV}" > if devfs_init_rulesets; then > devfs_apply_ruleset "1" "${DEV}" && \ # devfs_apply_ruleset ruleset [dir] # Apply ruleset number $ruleset to the devfs mountpoint $dir. # The ruleset argument must be a ruleset name as specified # in a devfs.rules(5) file. Take a look at /etc/defaults/devfs.rules if you're interested in how the symbolic names are assigned. hth, Doug -- Improve the effectiveness of your Internet presence with a domain name makeover! http://SupersetSolutions.com/ Computers are useless. They can only give you answers. -- Pablo Picasso
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4B443268.7040905>