CNID_DBD(8) | 3.1.12 | CNID_DBD(8) |
cnid_dbd - implement access to CNID databases through a dedicated daemon process
cnid_dbd
cnid_dbd -v | -V
cnid_dbd provides an interface for storage and retrieval of catalog node IDs (CNIDs) and related information to the afpd 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. cnid_dbd is part of the CNID backend framework of afpd and implements the dbd backend.
cnid_dbd is never started via the command line or system startup scripts but only by the cnid_metad daemon. There is one instance of cnid_dbd per netatalk volume.
cnid_dbd uses the Berkeley DB database library and uses transactionally protected updates. The dbd backend with transactions will avoid corruption of the CNID database even if the system crashes unexpectedly.
cnid_dbd inherits the effective userid and groupid from cnid_metad on startup, which is normally caused by afpd serving a netatalk volume to a client. It changes to the Berkeley DB database home directory dbdir that is associated with the volume. If the userid inherited from cnid_metad is 0 (root), cnid_dbd will change userid and groupid to the owner and group of the database home directory. Otherwise, it will continue to use the inherited values. cnid_dbd will then attempt to open the database and start serving requests using filedescriptor clntfd. Subsequent instances of afpd that want to access the same volume are redirected to the running cnid_dbd process by cnid_metad via the filedescriptor ctrlfd.
cnid_dbd can be configured to run forever or to exit after a period of inactivity. If cnid_dbd receives a TERM or an INT signal it will exit cleanly after flushing dirty database buffers to disk and closing Berkeley DB database environments. It is safe to terminate cnid_dbd 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).
The Berkeley DB database subsystem will create files named log.xxxxxxxxxx in the database home directory dbdir, where xxxxxxxxxx is a monotonically increasing integer. These files contain the transactional database changes. They will be removed regularly, unless the logfile_autoremove option is specified in the db_param configuration file (see below) with a value of 0 (default 1).
-v, -V
cnid_dbd reads configuration information from the file db_param in the database directory dbdir 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:
logfile_autoremove
cachesize
flush_frequency, flush_interval
fd_table_size
idle_timeout
Note that the first version to appear after Netatalk 2.1 i.e. 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.
In order to update between older Netatalk releases using different BerkeleyDB library versions, follow this steps:
10 Nov 2015 | 3.1.12 |