From owner-svn-src-head@FreeBSD.ORG Sun Apr 21 10:08:34 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 007D91D4; Sun, 21 Apr 2013 10:08:33 +0000 (UTC) (envelope-from joel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E7320E07; Sun, 21 Apr 2013 10:08:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3LA8XJN042322; Sun, 21 Apr 2013 10:08:33 GMT (envelope-from joel@svn.freebsd.org) Received: (from joel@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3LA8XKL042321; Sun, 21 Apr 2013 10:08:33 GMT (envelope-from joel@svn.freebsd.org) Message-Id: <201304211008.r3LA8XKL042321@svn.freebsd.org> From: Joel Dahl Date: Sun, 21 Apr 2013 10:08:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249720 - head/sbin/devfs X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 21 Apr 2013 10:08:34 -0000 Author: joel (doc committer) Date: Sun Apr 21 10:08:33 2013 New Revision: 249720 URL: http://svnweb.freebsd.org/changeset/base/249720 Log: Move EXAMPLES descriptions to before the actual command. PR: 177870 Submitted by: Bjorn Heidotting Modified: head/sbin/devfs/devfs.8 Modified: head/sbin/devfs/devfs.8 ============================================================================== --- head/sbin/devfs/devfs.8 Sun Apr 21 09:10:35 2013 (r249719) +++ head/sbin/devfs/devfs.8 Sun Apr 21 10:08:33 2013 (r249720) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 21, 2010 +.Dd April 21, 2013 .Dt DEVFS 8 .Os .Sh NAME @@ -269,13 +269,11 @@ the operations are performed on .Pa /dev (this only matters for things that might change the properties of nodes). .Pp -.Dl "devfs ruleset 10" -.Pp Specify that ruleset 10 should be the current ruleset for .Pa /dev -(if it does not already exist, it is created). +(if it does not already exist, it is created): .Pp -.Dl "devfs rule add path speaker mode 666" +.Dl "devfs ruleset 10" .Pp Add a rule that causes all nodes that have a path that matches .Dq Li speaker @@ -291,22 +289,19 @@ be changed if the node is created the rule is added (e.g., the .Pa atspeaker -module is loaded after the above rule is added). +module is loaded after the above rule is added): .Pp -.Dl "devfs rule applyset" +.Dl "devfs rule add path speaker mode 666" .Pp Apply all the rules in the current ruleset to all the existing nodes. -E.g., if the above rule was added after +E.g., if the below rule was added after .Pa /dev/speaker was created, this command will cause its file mode to be changed to 666 -as prescribed by the rule. +as prescribed by the rule: .Pp -.Dl devfs rule add path "snp*" mode 660 group snoopers +.Dl "devfs rule applyset" .Pp -(Quoting the argument to -.Cm path -is often necessary to disable the shell's globbing features.) For all devices with a path that matches .Dq Li snp* , set the file mode to 660 and the GID to @@ -315,53 +310,57 @@ This permits users in the .Dq Li snoopers group to use the .Xr snp 4 -devices. +devices +(quoting the argument to +.Cm path +is often necessary to disable the shell's globbing features): .Pp -.Dl "devfs rule -s 20 add type disk group wheel" +.Dl devfs rule add path "snp*" mode 660 group snoopers .Pp Add a rule to ruleset number 20. Since this ruleset is not the current ruleset for any mount-points, this rule is never applied automatically (unless ruleset 20 becomes -a current ruleset for some mount-point at a later time). -However, it can be applied explicitly, as such: +a current ruleset for some mount-point at a later time): .Pp -.Dl "devfs -m /my/jail/dev rule -s 20 applyset" +.Dl "devfs rule -s 20 add type disk group wheel" .Pp -This will apply all rules in ruleset number 20 to the DEVFS mount on +Explicitly apply all rules in ruleset number 20 to the DEVFS mount on .Pa /my/jail/dev . It does not matter that ruleset 20 is not the current ruleset for that -mount-point; the rules are still applied. +mount-point; the rules are still applied: .Pp -.Dl "devfs rule apply hide" +.Dl "devfs -m /my/jail/dev rule -s 20 applyset" .Pp -Since this rule has no conditions, the action +Since the following rule has no conditions, the action .Pq Cm hide -will be applied to all nodes. -Since hiding all nodes is not very useful, we can undo it: +will be applied to all nodes: .Pp -.Dl "devfs rule apply unhide" +.Dl "devfs rule apply hide" .Pp -which applies +Since hiding all nodes is not very useful, we can undo it. +The following applies .Cm unhide to all the nodes, -causing them to reappear. +causing them to reappear: .Pp -.Dl "devfs rule -s 10 add - < my_rules" +.Dl "devfs rule apply unhide" .Pp Add all the rules from the file .Pa my_rules -to ruleset 10. +to ruleset 10: .Pp -.Dl "devfs rule -s 20 show | devfs rule -s 10 add -" +.Dl "devfs rule -s 10 add - < my_rules" .Pp -Since -.Cm show -outputs valid rules, -this feature can be used to copy rulesets. -The above copies all the rules from ruleset 20 into ruleset 10. +The below copies all the rules from ruleset 20 into ruleset 10. The rule numbers are preserved, but ruleset 10 may already have rules with non-conflicting numbers (these will be preserved). +Since +.Cm show +outputs valid rules, +this feature can be used to copy rulesets: +.Pp +.Dl "devfs rule -s 20 show | devfs rule -s 10 add -" .Sh SEE ALSO .Xr chmod 1 , .Xr jail 2 ,