devfs ruleset processing in rc.subr
Doug Barton
dougb at FreeBSD.org
Wed Jan 6 06:49:09 UTC 2010
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
More information about the freebsd-rc
mailing list