When MongoDB starts in read-only mode, it will still log an error and exit if a lock file exists. However, if lock file creation fails due to a permission violation (or other error generated from writing to a RO directory), startup will continue without an error.
This work includes modifications to the lock file implementations on posix and windows as well as unit tests.