From owner-freebsd-stable@FreeBSD.ORG Tue Dec 13 20:23:01 2005 Return-Path: X-Original-To: freebsd-stable@freebsd.org Delivered-To: freebsd-stable@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8FE1A16A41F for ; Tue, 13 Dec 2005 20:23:01 +0000 (GMT) (envelope-from rsmith@xs4all.nl) Received: from smtp-vbr9.xs4all.nl (smtp-vbr9.xs4all.nl [194.109.24.29]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1D36043D6A for ; Tue, 13 Dec 2005 20:22:47 +0000 (GMT) (envelope-from rsmith@xs4all.nl) Received: from slackbox.xs4all.nl (slackbox.xs4all.nl [213.84.242.160]) by smtp-vbr9.xs4all.nl (8.13.3/8.13.3) with ESMTP id jBDKMYpM026555; Tue, 13 Dec 2005 21:22:35 +0100 (CET) (envelope-from rsmith@xs4all.nl) Received: by slackbox.xs4all.nl (Postfix, from userid 1001) id 8D8DBB827; Tue, 13 Dec 2005 21:22:34 +0100 (CET) Date: Tue, 13 Dec 2005 21:22:34 +0100 From: Roland Smith To: Brooks Davis Message-ID: <20051213202234.GB23420@slackbox.xs4all.nl> Mail-Followup-To: Brooks Davis , "[LoN]Kamikaze" , freebsd-stable@freebsd.org References: <439EF8B5.4030702@gmx.de> <20051213164947.GA17705@odin.ac.hmc.edu> <20051213180418.GA20852@slackbox.xs4all.nl> <20051213192143.GA5926@odin.ac.hmc.edu> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="yNb1oOkm5a9FJOVX" Content-Disposition: inline In-Reply-To: <20051213192143.GA5926@odin.ac.hmc.edu> User-Agent: Mutt/1.4.2.1i X-GPG-Fingerprint: 1A2B 477F 9970 BA3C 2914 B7CE 1277 EFB0 C321 A725 X-GPG-Key: http://www.xs4all.nl/~rsmith/pubkey.txt X-GPG-Notice: If this message is not signed, don't assume I sent it! X-Virus-Scanned: by XS4ALL Virus Scanner Cc: "\[LoN\]Kamikaze" , freebsd-stable@freebsd.org Subject: Re: devfs doesn't set access rights X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Dec 2005 20:23:01 -0000 --yNb1oOkm5a9FJOVX Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Dec 13, 2005 at 11:21:43AM -0800, Brooks Davis wrote: > > > This is normal. devfs.conf is for boot only, you need devfs.rules for > > > runtime. Unfortunatly, the documentation of this fact and the > > > docuementation of devfs.rules sucks. > >=20 > > Hmm, it's quite explicitly mentioned in the manual pages for devfs.conf= and > > devfs.rules.=20 > >=20 > > Feel free to suggest improvements... >=20 > 90% of the problem is the existence of devfs.conf. devfs(8) appears > capable of everything it does, but we still have two ways to do it which > is gratuitously confusing.=20 Hmm, I can mostly agree with that. The only real use I can think of for devfs.conf is when the devfs binary is corrupt. > The devfs(8) documentation is lacking in a > complete, working example,=20 What's wrong with the EXAMPLES section in devfs(8)? > any documentation of the rc.conf variables > (which also aren't documented in rc.conf(5) either), and any mention of > that the purpose or usage of lines like: >=20 > [devfsrules_unhide_basic=3D2] See devfs.rules(5), third para of DESCRIPTION. I agree it could use an example, and some explanation that you have to enable the ruleset in /etc/rc.conf. There is an example on my website: http://www.xs4all.nl/~rsmith/freebsd/#hotplug=20 Following is a patch for devfs.rules.5. Comments? Otherwise I'll submit it. ------------------ devfs.rules.5 patch -------------------------- --- devfs.rules.5 2005/12/13 19:59:29 1.6 +++ devfs.rules.5 2005/12/13 20:16:40 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD: /repoman/r/ncvs/src/share/man/man5/devfs.rules.5,v 1.2.4.1 2= 005/07/27 12:03:48 keramida Exp $ .\" -.Dd May 17, 2005 +.Dd Dec 13, 2005 .Dt DEVFS.RULES 5 .Os .Sh NAME @@ -72,8 +72,22 @@ .Dq Li usb group, the following rule may be used: .Pp +.Dl "[localrules=3D10]" .Dl "add path 'da*s*' mode 0660 group usb" .Pp +The first line declares and starts a new ruleset, with the name +.Va localrules +and the number 10. Rulesets should have a unique name and number. All +rules that follow a ruleset declaration belong to that ruleset, untill a +new ruleset is started. This ruleset has to be enabled in +.Pa /etc/rc.conf=20 +to be the ruleset for the=20 +.Pa /dev=20 +filesystem. This is done by putting the following line in=20 +.Pa /etc/rc.conf : +.Pp +.Dl "devfs_system_ruleset=3D""localrules""" +.Pp To make all the .Xr uscanner 4 devices accessible to their owner and the @@ -81,6 +95,7 @@ group, a similar rule may be used: .Pp .Dl "add path 'uscanner*' mode 0660 group usb" +.Pp .Sh SEE ALSO .Xr glob 3 , .Xr devfs 5 , ------------------ devfs.rules.5 patch -------------------------- > Setting the mode of a device node really ought to be trivial, but last > time I looked at it I was clearly missing something and couldn't get it > working. I decided the device in question really ought to be attached > at boot and thus gave up and used devfs.conf since I had productive > work to do. Some cook easy to use cookbook example would be really > helpful for those who don't have time to figure out all the details. Maybe my freebsd page can help. Most of the things I learned while configuring FreeBSD are documented here. http://www.xs4all.nl/~rsmith/freebsd > Comparativly few people will want to do anything more than make a device > or two more accessable. Agreed. But the mechanism is more general because devfs can be used in multiple places (e.g. jails). Roland --=20 R.F.Smith (http://www.xs4all.nl/~rsmith/) Please send e-mail as plain text. public key: http://www.xs4all.nl/~rsmith/pubkey.txt --yNb1oOkm5a9FJOVX Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2 (FreeBSD) iD8DBQFDny2KEnfvsMMhpyURAtwSAJ9Q4KZE/NNfQOad2eAz9n4TaX11vQCfe5bu 4UrVyQJei+Eb1zxz4qOeZg0= =JRmz -----END PGP SIGNATURE----- --yNb1oOkm5a9FJOVX--