summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2019-11-26 04:40:30 +0100
committerGitHub <noreply@github.com>2019-11-26 04:40:30 +0100
commitcfbb1c6def4a1ecce242e8eb6c92ebc5f103adbd (patch)
tree869e8e222e1fd1ffbe5e54f941e1c7f98dd52975 /src
parentMerge pull request #14151 from mk-fg/fix-timer-dump-syntax-bug (diff)
parentman: refer to systemd.syntax(7) from systemd.nspawn(5) (diff)
downloadsystemd-cfbb1c6def4a1ecce242e8eb6c92ebc5f103adbd.tar.xz
systemd-cfbb1c6def4a1ecce242e8eb6c92ebc5f103adbd.zip
Merge pull request #14134 from keszybz/variables-and-docs
Documentation and option parsing fixes
Diffstat (limited to 'src')
-rw-r--r--src/basic/terminal-util.c8
-rw-r--r--src/core/load-fragment-gperf.gperf.m44
-rw-r--r--src/core/load-fragment.c4
-rw-r--r--src/core/load-fragment.h4
4 files changed, 14 insertions, 6 deletions
diff --git a/src/basic/terminal-util.c b/src/basic/terminal-util.c
index 98c3ff04ef..511734cbbb 100644
--- a/src/basic/terminal-util.c
+++ b/src/basic/terminal-util.c
@@ -1206,6 +1206,11 @@ bool colors_enabled(void) {
val = getenv_bool("SYSTEMD_COLORS");
if (val >= 0)
cached_colors_enabled = val;
+
+ else if (getenv("NO_COLOR"))
+ /* We only check for the presence of the variable; value is ignored. */
+ cached_colors_enabled = false;
+
else if (getpid_cached() == 1)
/* PID1 outputs to the console without holding it open all the time */
cached_colors_enabled = !getenv_terminal_is_dumb();
@@ -1231,6 +1236,9 @@ bool dev_console_colors_enabled(void) {
if (b >= 0)
return b;
+ if (getenv("NO_COLOR"))
+ return false;
+
if (getenv_for_pid(1, "TERM", &s) <= 0)
(void) proc_cmdline_get_key("TERM", 0, &s);
diff --git a/src/core/load-fragment-gperf.gperf.m4 b/src/core/load-fragment-gperf.gperf.m4
index 42fc4eaac9..de08f7d067 100644
--- a/src/core/load-fragment-gperf.gperf.m4
+++ b/src/core/load-fragment-gperf.gperf.m4
@@ -166,6 +166,8 @@ $1.WatchdogSignal, config_parse_signal, 0,
)m4_dnl
m4_define(`CGROUP_CONTEXT_CONFIG_ITEMS',
`$1.Slice, config_parse_unit_slice, 0, 0
+$1.AllowedCPUs, config_parse_allowed_cpus, 0, offsetof($1, cgroup_context)
+$1.AllowedMemoryNodes, config_parse_allowed_mems, 0, offsetof($1, cgroup_context)
$1.CPUAccounting, config_parse_bool, 0, offsetof($1, cgroup_context.cpu_accounting)
$1.CPUWeight, config_parse_cg_weight, 0, offsetof($1, cgroup_context.cpu_weight)
$1.StartupCPUWeight, config_parse_cg_weight, 0, offsetof($1, cgroup_context.startup_cpu_weight)
@@ -173,8 +175,6 @@ $1.CPUShares, config_parse_cpu_shares, 0,
$1.StartupCPUShares, config_parse_cpu_shares, 0, offsetof($1, cgroup_context.startup_cpu_shares)
$1.CPUQuota, config_parse_cpu_quota, 0, offsetof($1, cgroup_context)
$1.CPUQuotaPeriodSec, config_parse_sec_def_infinity, 0, offsetof($1, cgroup_context.cpu_quota_period_usec)
-$1.CPUSetCpus, config_parse_cpuset_cpus, 0, offsetof($1, cgroup_context)
-$1.CPUSetMems, config_parse_cpuset_mems, 0, offsetof($1, cgroup_context)
$1.MemoryAccounting, config_parse_bool, 0, offsetof($1, cgroup_context.memory_accounting)
$1.MemoryMin, config_parse_memory_limit, 0, offsetof($1, cgroup_context)
$1.DefaultMemoryMin, config_parse_memory_limit, 0, offsetof($1, cgroup_context)
diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c
index 0631ea5ce2..54c71d3579 100644
--- a/src/core/load-fragment.c
+++ b/src/core/load-fragment.c
@@ -3146,7 +3146,7 @@ int config_parse_cpu_quota(
return 0;
}
-int config_parse_cpuset_cpus(
+int config_parse_allowed_cpus(
const char *unit,
const char *filename,
unsigned line,
@@ -3165,7 +3165,7 @@ int config_parse_cpuset_cpus(
return 0;
}
-int config_parse_cpuset_mems(
+int config_parse_allowed_mems(
const char *unit,
const char *filename,
unsigned line,
diff --git a/src/core/load-fragment.h b/src/core/load-fragment.h
index f369c4dc4f..b81887d510 100644
--- a/src/core/load-fragment.h
+++ b/src/core/load-fragment.h
@@ -90,8 +90,8 @@ CONFIG_PARSER_PROTOTYPE(config_parse_set_status);
CONFIG_PARSER_PROTOTYPE(config_parse_namespace_path_strv);
CONFIG_PARSER_PROTOTYPE(config_parse_temporary_filesystems);
CONFIG_PARSER_PROTOTYPE(config_parse_cpu_quota);
-CONFIG_PARSER_PROTOTYPE(config_parse_cpuset_cpus);
-CONFIG_PARSER_PROTOTYPE(config_parse_cpuset_mems);
+CONFIG_PARSER_PROTOTYPE(config_parse_allowed_cpus);
+CONFIG_PARSER_PROTOTYPE(config_parse_allowed_mems);
CONFIG_PARSER_PROTOTYPE(config_parse_protect_home);
CONFIG_PARSER_PROTOTYPE(config_parse_protect_system);
CONFIG_PARSER_PROTOTYPE(config_parse_bus_name);