If XDG_RUNTIME_DIR is set, locate index.pid in it. Thanks to Madhu for providing this fix
This commit is contained in:
parent
02e0c37add
commit
89375f5e80
@ -53,6 +53,7 @@
|
|||||||
#include "fstreewalk.h"
|
#include "fstreewalk.h"
|
||||||
#include "cpuconf.h"
|
#include "cpuconf.h"
|
||||||
#include "execmd.h"
|
#include "execmd.h"
|
||||||
|
#include "md5.h"
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
@ -1386,10 +1387,24 @@ string RclConfig::getIdxStatusFile() const
|
|||||||
{
|
{
|
||||||
return getCachedirPath("idxstatusfile", "idxstatus.txt");
|
return getCachedirPath("idxstatusfile", "idxstatus.txt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// The pid file is opened r/w every second by the GUI to check if the
|
||||||
|
// indexer is running. This is a problem for systems which spin down
|
||||||
|
// their disks. Locate it in XDG_RUNTIME_DIR if this is set.
|
||||||
|
// Thanks to user Madhu for this fix.
|
||||||
string RclConfig::getPidfile() const
|
string RclConfig::getPidfile() const
|
||||||
{
|
{
|
||||||
|
const char *p = getenv("XDG_RUNTIME_DIR");
|
||||||
|
if (p) {
|
||||||
|
string base = path_canon(p);
|
||||||
|
string digest;
|
||||||
|
return path_cat(
|
||||||
|
base, "/recoll-" + MD5HexPrint(getConfDir(), digest) + "-index.pid");
|
||||||
|
}
|
||||||
return path_cat(getCacheDir(), "index.pid");
|
return path_cat(getCacheDir(), "index.pid");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
string RclConfig::getIdxStopFile() const
|
string RclConfig::getIdxStopFile() const
|
||||||
{
|
{
|
||||||
return path_cat(getCacheDir(), "index.stop");
|
return path_cat(getCacheDir(), "index.stop");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user