Add parameter to chdir on recollindex startup, /tmp by default. Closes issue #129

This commit is contained in:
Jean-Francois Dockes
2013-03-07 11:05:54 +01:00
parent 73648e0052
commit 4a870f984d
5 changed files with 26 additions and 3 deletions
+12
View File
@@ -364,6 +364,18 @@ int main(int argc, char **argv)
}
o_reexec->atexit(cleanup);
string rundir;
config->getConfParam("idxrundir", rundir);
if (!rundir.compare("tmp")) {
LOGDEB(("recollindex: changing current directory to [%s]\n",
tmplocation().c_str()));
chdir(tmplocation().c_str());
} else if (!rundir.empty()) {
LOGDEB(("recollindex: changing current directory to [%s]\n",
rundir.c_str()));
chdir(rundir.c_str());
}
bool rezero((op_flags & OPT_z) != 0);
bool inPlaceReset((op_flags & OPT_Z) != 0);
Pidfile pidfile(config->getPidfile());