@@ -96,3 +96,6 @@ rdma-port=20049
#
[svcgssd]
# principal=
+
+[reexport]
+# sqlitedb=
@@ -12,6 +12,7 @@
#include <unistd.h>
#include "nfsd_path.h"
+#include "conffile.h"
#include "nfslib.h"
#include "reexport.h"
#include "xcommon.h"
@@ -55,7 +56,9 @@ int reexpdb_init(void)
if (prng_init() != 0)
return -1;
- ret = sqlite3_open_v2(REEXPDB_DBFILE, &db, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | SQLITE_OPEN_FULLMUTEX, NULL);
+ ret = sqlite3_open_v2(conf_get_str_with_def("reexport", "sqlitedb", REEXPDB_DBFILE),
+ &db, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE | SQLITE_OPEN_FULLMUTEX,
+ NULL);
if (ret != SQLITE_OK) {
xlog(L_ERROR, "Unable to open reexport database: %s", sqlite3_errstr(ret));
return -1;
@@ -295,6 +295,12 @@ Only
.B debug=
is recognized.
+.TP
+.B reexport
+Only
+.B sqlitedb=
+is recognized, path to the state database.
+
.SH FILES
.TP 10n
.I /etc/nfs.conf
With the database location configurable it is possible to place the sqlite database on a shared filesystem. That way the reexport state can be shared among multiple re-exporting NFS servers. Be careful with shared filesystems, SQLite assumes that file locking works on such filesystems. Not all filesystems implement this correctly. Signed-off-by: Richard Weinberger <richard@nod.at> --- nfs.conf | 3 +++ support/reexport/reexport.c | 5 ++++- systemd/nfs.conf.man | 6 ++++++ 3 files changed, 13 insertions(+), 1 deletion(-)