3 .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
4 .\" Generator: DocBook XSL Stylesheets v1.74.3 <http://docbook.sf.net/>
6 .\" Manual: Netatalk 2.1beta
7 .\" Source: Netatalk 2.1beta
10 .TH "CNID_DBD" "8" "21 Mar 2009" "Netatalk 2.1beta" "Netatalk 2.1beta"
11 .\" -----------------------------------------------------------------
12 .\" * set default formatting
13 .\" -----------------------------------------------------------------
14 .\" disable hyphenation
16 .\" disable justification (adjust text to left margin only)
18 .\" -----------------------------------------------------------------
19 .\" * MAIN CONTENT STARTS HERE *
20 .\" -----------------------------------------------------------------
22 cnid_dbd \- implement access to CNID databases through a dedicated daemon process
24 .HP \w'\fBcnid_dbd\fR\fB\fR\fB\fR\fB\fR\ 'u
25 \fBcnid_dbd\fR\fB\fR\fB\fR\fB\fR \fIdbdir\fR \fIctrlfd\fR \fIclntfd\fR \fIlogconfig_string\fR
29 provides an interface for storage and retrieval of catalog node IDs (CNIDs) and related information to the
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\&.
42 is never started via the command line or system startup scripts but only by the
44 daemon\&. There is at most one instance of
46 per netatalk volume\&.
51 database library and uses transactionally protected updates\&. The
53 backend with transactions will avoid corruption of the CNID database even if the system crashes unexpectedly\&.
56 uses the same on\-disk database format as the
58 backend\&. It is therefore possible to switch between the two backends as necessary\&.
61 inherits the effective userid and groupid from
63 on startup, which is normally caused by
65 serving a netatalk volume to a client\&. It changes to the
67 database home directory
69 that is associated with the volume\&. If the userid inherited from
73 will change userid and groupid to the owner and group of the database home directory\&. Otherwise, it will continue to use the inherited values\&.
75 will then attempt to open the database and start serving requests using filedescriptor
76 \fIclntfd\fR\&. Subsequent instances of
78 that want to access the same volume are redirected to the running
82 via the filedescriptor
87 \fBlogconfig_string\fR
90 to configure its logging output\&.
93 can be configured to run forever or to exit after a period of inactivity\&. If
95 receives a TERM or an INT signal it will exit cleanly after flushing dirty database buffers to disk and closing
97 database environments\&. It is safe to terminate
99 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)\&.
103 database subsystem will create files named log\&.xxxxxxxxxx in the database home directory
104 \fIdbdir\fR, where xxxxxxxxxx is a monotonically increasing integer\&. These files contain ithe transactional database changes\&. They will be removed regularily, unless the
105 \fBlogfile_autoremove\fR
106 option is specified in the
108 configuration file (see below)\&.
112 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
114 configuration file to put the database onto a local disk\&.
118 reads configuration information from the file
120 in the database directory
122 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:
124 \fBlogfile_autoremove\fR
126 If set to 0, unused Berkeley DB transactional logfiles (log\&.xxxxxxxxxx in the database home directory) are not removed on startup of
128 and on a reqular basis\&. Default: 1\&.
133 Determines the size of the Berkeley DB cache in kilobytes\&. Default: 8192\&. Each
135 process grabs that much memory on top of its normal memory footprint\&. It can be used to tune database performance\&. The
139 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
140 \fBBerkeley DB Tutorial and Reference Guide\fR
142 \fBSelecting a cache size\fR
143 that gives more detailed information\&.
146 \fBflush_frequency\fR, \fBflush_interval\fR
148 \fIflush_frequency\fR
151 (Default: 1800) control how often changes to the database are checkpointed\&. Both of these operations are performed if either i) more than
152 \fIflush_frequency\fR
153 requests have been received or ii) more than
155 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\&.
160 is the maximum number of connections (filedescriptors) that can be open for
164 Default: 512\&. If this number is exceeded, one of the existing connections is closed and reused\&. The affected
166 process will transparently reconnect later, which causes slight overhead\&. On the other hand, setting this parameter too high could affect performance in
168 since all descriptors have to be checked in a
170 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
172 client process is expected to run, e\&.g\&. home directories\&.
177 is the number of seconds of inactivity before an idle
179 exits\&. Default: 600\&. Set this to 0 to disable the timeout\&.
183 In order to update between Netatalk releases using different BerkeleyDB library versions, follow this steps:
193 Stop the to be upgraded old version of Netatalk
204 Using the old BerkeleyDB utilities run
205 \fBdb_recover \-h <path to \&.AppleDB>\fR
216 Using the new BerkeleyDB utilities run
217 \fBdb_upgrade \-v \-h <path to \&.AppleDB> \-f cnid2\&.db\fR
228 Again using the new BerkeleyDB utilities run
229 \fBdb_checkpoint \-1 \-h <path to \&.AppleDB>\fR
240 Start the the new version of Netatalk
243 Note that the first version to appear
245 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\&.