Bug 212777 - net/netatalk - dependency db5 appears to be missing option to support use with netatalk
Summary: net/netatalk - dependency db5 appears to be missing option to support use wit...
Status: Closed Feedback Timeout
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: arm Any
: --- Affects Some People
Assignee: Joe Marcus Clarke
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-09-17 17:41 UTC by Charles Mercadal
Modified: 2018-09-05 16:35 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Charles Mercadal 2016-09-17 17:41:30 UTC
Good day:

(It has been some time since I have submitted a FreeBSD bug report; please accept my apologies in advance if I've missed something or included too many details.)

I am currently running FreeBSD 11.0-RC2 on a Raspberry pi 2.  Using pkg, I installed the current netatalk package, netatalk-2.2.5_5,1, which requires db5, db5-5.3.28_4 is installed.

I configured netatalk to run as an afp daemon, which requires cnid_metad to run as well.  cnid_metad and cnid_dbd rely on db5 to maintain filesystem data.

After configuring and running /usr/local/etc/rc.d/netatalk start, I connected with a client and received a message on the Mac client that there is "Something wrong with the volume's CNID DB, using temporary CNID DB instead. Check server messages for details. Switching to read-only mode."

The logs in the .AppleDB folder on the folder that acts as the root for the volume reports the following error repeatedly:

BDB1577 Berkeley DB library configured to support only private environments
BDB2526 Finding last valid log LSN: file: 1 offset 28

I take this to mean that some compile-time option for db5 is set or missing, such that the package as installed cannot support options needed by the netatalk cnid database.
Comment 1 Charles Mercadal 2016-09-19 21:12:03 UTC
I believe I may have figured out why this bug exists in netatalk using the packaged version of db5 on arm.  I'm not yet sure there's a reasonable solution to fix it:

Bug 152418 & some later bugs proposed changes to the db5 Makefile; on arm db5 is built with an argument --enable-posixmutexes.

Per db5 documentation "... configuring to use POSIX mutexes when the implementation does not have inter-process support will only allow the creation of private database environments, that is, environments where the DB_PRIVATE flag is specified to the DB_ENV->open() method."  https://docs.oracle.com/cd/E17275_01/html/programmer_reference/build_unix_conf.html

Going to keep exploring workarounds to see if I can get netatalk running, and for the benefit of others who may run into this problem.
Comment 2 Charles Mercadal 2016-09-19 21:13:35 UTC
Not sure what was in my paste buffer:  Bug 197227 & some later bugs proposed changes to the db5 Makefile; on arm db5 is built with an argument --enable-posixmutexes.
Comment 3 Charles Mercadal 2016-09-26 19:57:44 UTC
(In reply to mercadal from comment #1)

Potential workaround:  For each of the volumes, in the AppleVolumes.default file, I specified "cnidscheme:tdb" for each volume, so netatalk would use the tdb file format instead of db5 for each volume.

In case anyone else is trying to run afpd in netatalk on arm, this might fix your issues.  Be advised, however, it is only supported with one client!  Per http://netatalk.sourceforge.net/2.1/htmldocs/configuration.html#id2258038 "Only ever use [tdb] for volumes that are not shared and accessed by multiple clients at once!"
Comment 4 Joe Marcus Clarke freebsd_committer freebsd_triage 2018-02-18 20:20:17 UTC
Is there any request for a change to netatalk here?  It sounds to me like this workaround might be dangerous.  But if I could add an ARM-specific pkg-message with your text, I suppose.  Would that be sufficient?
Comment 5 Charles Mercadal 2018-03-12 17:58:43 UTC
(In reply to Joe Marcus Clarke from comment #4)

Let me look into if db5 still has an issue; this is fundamentally a db5 bug that netatalk exposed.

If the bug is still there, I think offering a warning via pkg-message would prevent headaches for others using netatalk on arm.
Comment 6 Joe Marcus Clarke freebsd_committer freebsd_triage 2018-09-05 16:35:23 UTC
If this is still an issue, please re-open this PR.