Added unstable warning and fixed daemonization

This commit is contained in:
Sebastian Meßmer 2015-10-16 02:38:34 +02:00
parent 5f9c2c0611
commit 1c29fecf3c

View File

@ -1,4 +1,4 @@
ß#include <messmer/blockstore/implementations/ondisk/OnDiskBlockStore.h>
#include <messmer/blockstore/implementations/ondisk/OnDiskBlockStore.h>
#include <messmer/blockstore/implementations/inmemory/InMemoryBlockStore.h>
#include <messmer/blockstore/implementations/inmemory/InMemoryBlock.h>
#include <cmath>
@ -29,7 +29,8 @@ using std::vector;
//TODO Support files > 4GB
//TODO Improve parallelity.
//TODO Seems to deadlock in bonnie++ second run (in the create files sequentially) - maybe also in a later run or different step?
//TODO Did deadlock in bonnie++ second run (in the create files sequentially) - maybe also in a later run or different step?
//TODO Improve error message when root blob wasn't found.
void showVersion() {
cout << "CryFS Version " << version::VERSION_STRING << endl;
@ -38,6 +39,9 @@ void showVersion() {
". Please do not use in production!" << endl;
} else if (!version::IS_STABLE_VERSION) {
cout << "WARNING! This is an experimental version. Please backup your data frequently!" << endl;
} else {
//TODO This is shown for stable version numbers like 0.8 - remove once we reach 1.0
cout << "WARNING! This version is not considered stable. Please backup your data frequently!" << endl;
}
#ifndef NDEBUG
cout << "WARNING! This is a debug build. Performance might be slow." << endl;
@ -47,6 +51,12 @@ void showVersion() {
void runFilesystem(const ProgramOptions &options) {
auto config = CryConfigLoader().loadOrCreate(bf::path(options.configFile()));
//TODO This daemonize causes error messages when initializing CryDevice to get lost.
// However, initializing CryDevice might (?) already spawn threads and we have to do daemonization before that
// because it doesn't fork threads. What to do?
if (!options.foreground()) {
cpputils::daemonize();
}
auto blockStore = make_unique_ref<OnDiskBlockStore>(bf::path(options.baseDir()));
CryDevice device(std::move(config), std::move(blockStore));
fspp::FilesystemImpl fsimpl(&device);
@ -61,10 +71,6 @@ int main(int argc, char *argv[]) {
showVersion();
ProgramOptions options = program_options::Parser(argc, argv).parse();
if (!options.foreground()) {
cpputils::daemonize();
}
runFilesystem(options);
return 0;
}