diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2017-08-11 14:09:58 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2017-08-11 14:09:58 +0000 |
commit | ed7e4385c6c73eaeabe6b8194430d2d8e808f422 (patch) | |
tree | d3afc8c99f9a7d25f2a75a9ed44708c921e42091 /configd/src | |
parent | 1befefc3c4ecf2f6328424e2c6bb31f3ec1d2eac (diff) |
Write to a directory only writable by vespa user.
Diffstat (limited to 'configd/src')
-rw-r--r-- | configd/src/apps/sentinel/service.cpp | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/configd/src/apps/sentinel/service.cpp b/configd/src/apps/sentinel/service.cpp index 9652db71a32..5153a98d1ff 100644 --- a/configd/src/apps/sentinel/service.cpp +++ b/configd/src/apps/sentinel/service.cpp @@ -15,18 +15,13 @@ LOG_SETUP(".service", "$Id$"); extern sig_atomic_t stop; -namespace config { -namespace sentinel { +namespace config::sentinel { namespace { -std::string getTempDir() { - const char * configuredTmp = getenv("TMPDIR"); - if (configuredTmp) { - return configuredTmp; - } +std::string getVespaTempDir() { std::string tmp = getenv("ROOT"); - tmp += "/tmp"; + tmp += "var/db/vespa/tmp"; return tmp; } @@ -114,7 +109,7 @@ Service::terminate(bool catchable) setState(KILLING); char pstackCmd[256]; LOG(info, "%s:%d failed to stop. Will dump the stack", name().c_str(), _pid); - snprintf(pstackCmd, sizeof(pstackCmd), "pstack %d > %s/%s.pstack.%d", _pid, getTempDir().c_str(), name().c_str(), _pid); + snprintf(pstackCmd, sizeof(pstackCmd), "pstack %d > %s/%s.pstack.%d", _pid, getVespaTempDir().c_str(), name().c_str(), _pid); int pstackRet = system(pstackCmd); if (pstackRet != 0) { LOG(warning, "'%s' failed with return value %d", pstackCmd, pstackRet); @@ -447,6 +442,5 @@ Service::stateName(ServiceState state) const return "--BAD--"; } +} -} // end namespace sentinel -} // end namespace config |