From 2369180fd41d3bd8e15d07dae3d6e0d58595f2a3 Mon Sep 17 00:00:00 2001 From: Patrick Donnelly Date: Fri, 10 May 2024 09:45:27 -0400 Subject: [PATCH] common/options: add configs for temporary files made by daemons Signed-off-by: Patrick Donnelly (cherry picked from commit de350ccc4362903dc8fab2e166454f0675dde7f1) --- src/common/config.cc | 5 +++++ src/common/options/global.yaml.in | 23 +++++++++++++++++++++++ 2 files changed, 28 insertions(+) diff --git a/src/common/config.cc b/src/common/config.cc index c8101587b71..604b3c35d5e 100644 --- a/src/common/config.cc +++ b/src/common/config.cc @@ -493,6 +493,11 @@ void md_config_t::parse_env(unsigned entity_type, } } + if (auto s = getenv("TMPDIR"); s) { + string err; + _set_val(values, tracker, s, *find_option("tmp_dir"), CONF_ENV, &err); + } + // Apply pod memory limits: // // There are two types of resource requests: `limits` and `requests`. diff --git a/src/common/options/global.yaml.in b/src/common/options/global.yaml.in index 76a4f4d9551..66c8bd83908 100644 --- a/src/common/options/global.yaml.in +++ b/src/common/options/global.yaml.in @@ -250,6 +250,29 @@ options: flags: - startup with_legacy: true +- name: tmp_dir + type: str + level: advanced + desc: path for the 'tmp' directory + default: /tmp + services: + - common + see_also: + - admin_socket + flags: + - runtime +- name: tmp_file_template + type: str + level: advanced + desc: Template for temporary files created by daemons for ceph tell commands + long_desc: The template file name prefix for temporary files. For example, temporary files may be created by `ceph tell` commands using the --daemon-output-file switch. + daemon_default: $tmp_dir/$cluster-$name.XXXXXX + services: + - osd + - mds + - mon + flags: + - runtime - name: admin_socket type: str level: advanced -- 2.39.5