]> arthur.barton.de Git - netatalk.git/blob - man/man8/cnid_dbd.8.tmpl
Merge master
[netatalk.git] / man / man8 / cnid_dbd.8.tmpl
1 '\" t
2 .\"     Title: cnid_dbd
3 .\"    Author: [FIXME: author] [see http://docbook.sf.net/el/author]
4 .\" Generator: DocBook XSL Stylesheets v1.75.2 <http://docbook.sf.net/>
5 .\"      Date: 10 Dec 2010
6 .\"    Manual: Netatalk 2.2
7 .\"    Source: Netatalk 2.2
8 .\"  Language: English
9 .\"
10 .TH "CNID_DBD" "8" "10 Dec 2010" "Netatalk 2.2" "Netatalk 2.2"
11 .\" -----------------------------------------------------------------
12 .\" * set default formatting
13 .\" -----------------------------------------------------------------
14 .\" disable hyphenation
15 .nh
16 .\" disable justification (adjust text to left margin only)
17 .ad l
18 .\" -----------------------------------------------------------------
19 .\" * MAIN CONTENT STARTS HERE *
20 .\" -----------------------------------------------------------------
21 .SH "NAME"
22 cnid_dbd \- implement access to CNID databases through a dedicated daemon process
23 .SH "SYNOPSIS"
24 .HP \w'\fBcnid_dbd\fR\fB\fR\fB\fR\fB\fR\ 'u
25 \fBcnid_dbd\fR\fB\fR\fB\fR\fB\fR \fIvolpath\fR \fIctrlfd\fR \fIclntfd\fR \fIlogconfig_string\fR
26 .SH "DESCRIPTION"
27 .PP
28 \fBcnid_dbd\fR
29 provides an interface for storage and retrieval of catalog node IDs (CNIDs) and related information to the
30 \fBafpd\fR
31 daemon\&. CNIDs are a component of Macintosh based file systems with semantics that map not easily onto Unix file systems\&. This makes separate storage in a database necessary\&.
32 \fBcnid_dbd\fR
33 is part of the
34 \fBCNID backend\fR
35 framework of
36 \fBafpd\fR
37 and implements the
38 \fBdbd\fR
39 backend\&.
40 .PP
41 \fBcnid_dbd\fR
42 is never started via the command line or system startup scripts but only by the
43 \fBcnid_metad\fR
44 daemon\&. There is one instance of
45 \fBcnid_dbd\fR
46 per netatalk volume\&.
47 .PP
48 \fBcnid_dbd\fR
49 uses the
50 \fBBerkleley DB\fR
51 database library and uses transactionally protected updates\&. The
52 \fBdbd\fR
53 backend with transactions will avoid corruption of the CNID database even if the system crashes unexpectedly\&.
54 .PP
55 \fBcnid_dbd\fR
56 inherits the effective userid and groupid from
57 \fBcnid_metad\fR
58 on startup, which is normally caused by
59 \fBafpd\fR
60 serving a netatalk volume to a client\&. It changes to the
61 \fBBerkleley DB\fR
62 database home directory
63 \fIdbdir\fR
64 that is associated with the volume\&. If the userid inherited from
65 \fBcnid_metad\fR
66 is 0 (root),
67 \fBcnid_dbd\fR
68 will change userid and groupid to the owner and group of the database home directory\&. Otherwise, it will continue to use the inherited values\&.
69 \fBcnid_dbd\fR
70 will then attempt to open the database and start serving requests using filedescriptor
71 \fIclntfd\fR\&. Subsequent instances of
72 \fBafpd\fR
73 that want to access the same volume are redirected to the running
74 \fBcnid_dbd\fR
75 process by
76 \fBcnid_metad\fR
77 via the filedescriptor
78 \fIctrlfd\fR\&.
79 .PP
80 \fBcnid_dbd\fR
81 uses
82 \fBlogconfig_string\fR
83 which is passed from
84 \fBcnid_metad\fR
85 to configure its logging output\&.
86 .PP
87 \fBcnid_dbd\fR
88 can be configured to run forever or to exit after a period of inactivity\&. If
89 \fBcnid_dbd\fR
90 receives a TERM or an INT signal it will exit cleanly after flushing dirty database buffers to disk and closing
91 \fBBerkleley DB\fR
92 database environments\&. It is safe to terminate
93 \fBcnid_dbd\fR
94 this way, it will be restarted when necessary\&. Other signals are not handled and will cause an immediate exit, possibly leaving the CNID database in an inconsistent state (no transactions) or losing recent updates during recovery (transactions)\&.
95 .PP
96 The
97 \fBBerkleley DB\fR
98 database subsystem will create files named log\&.xxxxxxxxxx in the database home directory
99 \fIdbdir\fR, where xxxxxxxxxx is a monotonically increasing integer\&. These files contain ithe transactional database changes\&. They will be removed regularily, unless the
100 \fBlogfile_autoremove\fR
101 option is specified in the
102 \fIdb_param\fR
103 configuration file (see below) with a value of 0 (default 1)\&.
104 .PP
105 Do not use
106 \fBcnid_dbd\fR
107 for databases on NFS mounted file systems\&. It makes the whole point of securing database changes properly moot\&. Use the dbdir: Option in the appropriate
108 \fBAppleVolumes\fR
109 configuration file to put the database onto a local disk\&.
110 .SH "CONFIGURATION"
111 .PP
112 \fBcnid_dbd\fR
113 reads configuration information from the file
114 \fIdb_param\fR
115 in the database directory
116 \fIdbdir\fR
117 on startup\&. If the file does not exist or a parameter is not listed, suitable default values are used\&. The format for a single parameter is the parameter name, followed by one or more spaces, followed by the parameter value, followed by a newline\&. The following parameters are currently recognized:
118 .PP
119 \fBlogfile_autoremove\fR
120 .RS 4
121 If set to 0, unused Berkeley DB transactional logfiles (log\&.xxxxxxxxxx in the database home directory) are not removed on startup of
122 \fBcnid_dbd\fR
123 and on a reqular basis\&. Default: 1\&.
124 .RE
125 .PP
126 \fBcachesize\fR
127 .RS 4
128 Determines the size of the Berkeley DB cache in kilobytes\&. Default: 8192\&. Each
129 \fBcnid_dbd\fR
130 process grabs that much memory on top of its normal memory footprint\&. It can be used to tune database performance\&. The
131 \fBdb_stat\fR
132 utility with the
133 \fB\-m\fR
134 option that comes with Berkely DB can help you determine wether you need to change this value\&. The default is pretty conservative so that a large percentage of requests should be satisfied from the cache directly\&. If memory is not a bottleneck on your system you might want to leave it at that value\&. The
135 \fBBerkeley DB Tutorial and Reference Guide\fR
136 has a section
137 \fBSelecting a cache size\fR
138 that gives more detailed information\&.
139 .RE
140 .PP
141 \fBflush_frequency\fR, \fBflush_interval\fR
142 .RS 4
143 \fIflush_frequency\fR
144 (Default: 1000) and
145 \fIflush_interval\fR
146 (Default: 1800) control how often changes to the database are checkpointed\&. Both of these operations are performed if either i) more than
147 \fIflush_frequency\fR
148 requests have been received or ii) more than
149 \fIflush_interval\fR
150 seconds have elapsed since the last save/checkpoint\&. Be careful to check your harddisk configuration for on disk cache settings\&. Many IDE disks just cache writes as the default behaviour, so even flushing database files to disk will not have the desired effect\&.
151 .RE
152 .PP
153 \fBfd_table_size\fR
154 .RS 4
155 is the maximum number of connections (filedescriptors) that can be open for
156 \fBafpd\fR
157 client processes in
158 \fBcnid_dbd\&.\fR
159 Default: 512\&. If this number is exceeded, one of the existing connections is closed and reused\&. The affected
160 \fBafpd\fR
161 process will transparently reconnect later, which causes slight overhead\&. On the other hand, setting this parameter too high could affect performance in
162 \fBcnid_dbd\fR
163 since all descriptors have to be checked in a
164 \fBselect()\fR
165 system call, or worse, you might exceed the per process limit of open file descriptors on your system\&. It is safe to set the value to 1 on volumes where only one
166 \fBafpd\fR
167 client process is expected to run, e\&.g\&. home directories\&.
168 .RE
169 .PP
170 \fBidle_timeout\fR
171 .RS 4
172 is the number of seconds of inactivity before an idle
173 \fBcnid_dbd\fR
174 exits\&. Default: 600\&. Set this to 0 to disable the timeout\&.
175 .RE
176 .SH "UPDATING"
177 .PP
178 Note that the first version to appear
179 \fIafter\fR
180 Netatalk 2\&.1 ie Netatalk 2\&.1\&.1, will support BerkeleyDB updates on the fly without manual intervention\&. In other words Netatalk 2\&.1 does contain code to prepare the BerkeleyDB database for upgrades and to upgrade it in case it has been prepared before\&. That means it can\'t upgrade a 2\&.0\&.x version because that one didn\'t prepare the database\&.
181 .PP
182 In order to update between older Netatalk releases using different BerkeleyDB library versions, follow this steps:
183 .sp
184 .RS 4
185 .ie n \{\
186 \h'-04'\(bu\h'+03'\c
187 .\}
188 .el \{\
189 .sp -1
190 .IP \(bu 2.3
191 .\}
192 Stop the to be upgraded old version of Netatalk
193 .RE
194 .sp
195 .RS 4
196 .ie n \{\
197 \h'-04'\(bu\h'+03'\c
198 .\}
199 .el \{\
200 .sp -1
201 .IP \(bu 2.3
202 .\}
203 Using the old BerkeleyDB utilities run
204 \fBdb_recover \-h <path to \&.AppleDB>\fR
205 .RE
206 .sp
207 .RS 4
208 .ie n \{\
209 \h'-04'\(bu\h'+03'\c
210 .\}
211 .el \{\
212 .sp -1
213 .IP \(bu 2.3
214 .\}
215 Using the new BerkeleyDB utilities run
216 \fBdb_upgrade \-v \-h <path to \&.AppleDB> \-f cnid2\&.db\fR
217 .RE
218 .sp
219 .RS 4
220 .ie n \{\
221 \h'-04'\(bu\h'+03'\c
222 .\}
223 .el \{\
224 .sp -1
225 .IP \(bu 2.3
226 .\}
227 Again using the new BerkeleyDB utilities run
228 \fBdb_checkpoint \-1 \-h <path to \&.AppleDB>\fR
229 .RE
230 .sp
231 .RS 4
232 .ie n \{\
233 \h'-04'\(bu\h'+03'\c
234 .\}
235 .el \{\
236 .sp -1
237 .IP \(bu 2.3
238 .\}
239 Start the the new version of Netatalk
240 .RE
241 .SH "SEE ALSO"
242 .PP
243 \fBcnid_metad\fR(8),
244 \fBafpd\fR(8),
245 \fBdbd\fR(1)