Merge from vendor branch LESS:
[dragonfly.git] / share / man / man5 / devices.conf.5
1 .\" Copyright (c) 2005 Joerg Anslik <joerg@anslik.de>
2 .\" All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\"    notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\"    notice, this list of conditions and the following disclaimer in the
11 .\"    documentation and/or other materials provided with the distribution.
12 .\"
13 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23 .\" SUCH DAMAGE.
24 .\"
25 .\" $DragonFly: src/share/man/man5/devices.conf.5,v 1.3 2007/04/26 17:35:03 swildner Exp $
26 .\"
27 .\" Note: The date here should be updated whenever a non-trivial
28 .\" change is made to the manual page.
29 .Dd March 18, 2005
30 .Dt DEVICES.CONF 5
31 .Os
32 .Sh NAME
33 .Nm devices.conf
34 .Nd override ownership and permissions for device nodes
35 .Sh SYNOPSIS
36 .Pa /etc/devices.conf
37 .Sh DESCRIPTION
38 The
39 .Nm
40 file is used by the
41 .Xr MAKEDEV 8
42 shell script.
43 Normally,
44 .Xr MAKEDEV 8
45 creates any special
46 file (device node) with reasonable ownership and permissions. To override these default
47 settings, you can put corresponding entries in your
48 .Pa devices.conf
49 file, so
50 .Xr MAKEDEV 8
51 will use these when it creates the special file.
52 .Pp
53 This feature comes in handy if you're using (e.g.) tape backup software like
54 .Pa bacula
55 in conjunction with a tape autochanger device. In this case, the
56 .Dq bacula-sd
57 storage daemon needs read/write access to /dev/pass?, which is not granted by default
58 when
59 .Xr MAKEDEV 8
60 creates the pass? device node.
61 .Pp
62 So, instead of manually changing the permissions of /dev/pass? after each
63 .Dq make upgrade ,
64 you can simply put a local override entry into
65 .Pa devices.conf ,
66 so the device node will have the new permissions the next time
67 .Xr MAKEDEV 8
68 creates it.
69 .Sh FILE FORMAT
70 The contents of the
71 .Nm
72 file is plain ASCII and can be modified with the
73 text editor of your choice.
74 Lines with a
75 .Ql #
76 in the first column are comments and are ignored, which also holds true
77 for blank lines.
78 .Pp
79 A configuration line consists of up to four fields separated
80 by whitespace. The first three fields are mandatory, and contain the name of the device
81 node to be overridden, the ownership in
82 .Dq owner:group
83 format and the new file permissions. The fourth field is optional and
84 reserved for comments (or whatever).
85 .Pp
86 Due to the huge number of device nodes that
87 .Xr MAKEDEV 8
88 can create,
89 the first field (the device node name) may contain the
90 .Ql *
91 wildcard character, if the new ownership/permissions should apply to an entire
92 device family (see EXAMPLES).
93 .Sh FILES
94 .Bl -tag -width ".Pa devices.conf"
95 .It Pa devices.conf
96 The local device permissions override file lives in
97 .Pa /etc .
98 .El
99 .Sh EXAMPLES
100 The following is an example of how to set up local overrides for some
101 device nodes.
102 .Bd -literal
103 # Grant read and write permission on /dev/pass0 to the bacula-sd,
104 # which belongs to the operator group.
105 pass0   root:operator   660
106
107 # Change ownership and permissions for the entire ad0 device family
108 ad0*    root:man        640
109
110 # Grant read and write access to sa* control nodes to everyone
111 sa*.ctl root:wheel      666
112
113 # Change ownership and permissions for device node "4" in /dev/fd
114 fd/4    ihate:floppies  000
115
116 # Grant mommy write access to my fridge
117 fridge  mommy:supplies  640     # Will be ignored by MAKEDEV(8)...
118 .Ed
119 .Sh SEE ALSO
120 .Xr MAKEDEV 8