2020-11-09 05:23:58 +01:00
|
|
|
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
2012-07-18 19:07:51 +02:00
|
|
|
#pragma once
|
2009-11-19 23:13:20 +01:00
|
|
|
|
2018-05-22 13:10:17 +02:00
|
|
|
#include "conf-parser.h"
|
2010-01-26 21:39:06 +01:00
|
|
|
#include "unit.h"
|
2009-11-19 23:13:20 +01:00
|
|
|
|
2019-06-20 18:51:42 +02:00
|
|
|
/* Config-parsing helpers relevant only for sources under src/core/ */
|
|
|
|
int parse_crash_chvt(const char *value, int *data);
|
|
|
|
int parse_confirm_spawn(const char *value, char **console);
|
|
|
|
|
2009-11-19 23:13:20 +01:00
|
|
|
/* Read service data from .desktop file style configuration fragments */
|
|
|
|
|
2010-04-10 17:53:17 +02:00
|
|
|
int unit_load_fragment(Unit *u);
|
|
|
|
|
|
|
|
void unit_dump_config_items(FILE *f);
|
2009-11-19 23:13:20 +01:00
|
|
|
|
2018-05-22 13:10:17 +02:00
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_unit_deps);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_obsolete_unit_deps);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_unit_string_printf);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_unit_strv_printf);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_unit_path_printf);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_unit_path_strv_printf);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_documentation);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_socket_listen);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_socket_protocol);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_socket_bind);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_exec_nice);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_exec_oom_score_adjust);
|
2020-04-04 16:43:25 +02:00
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_exec_coredump_filter);
|
2018-05-22 13:10:17 +02:00
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_exec);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_service_timeout);
|
2017-11-29 07:43:44 +01:00
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_service_timeout_abort);
|
2019-04-16 16:45:20 +02:00
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_service_timeout_failure_mode);
|
2018-05-22 13:10:17 +02:00
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_service_type);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_service_restart);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_socket_bindtodevice);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_exec_output);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_exec_input);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_exec_input_text);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_exec_input_data);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_exec_io_class);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_exec_io_priority);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_exec_cpu_sched_policy);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_exec_cpu_sched_prio);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_exec_cpu_affinity);
|
2020-09-22 14:08:05 +02:00
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_exec_mount_apivfs);
|
2018-05-22 13:10:17 +02:00
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_exec_secure_bits);
|
2020-06-29 14:19:31 +02:00
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_root_image_options);
|
2020-06-03 10:50:45 +02:00
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_exec_root_hash);
|
2020-06-08 15:02:55 +02:00
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_exec_root_hash_sig);
|
2018-05-22 13:10:17 +02:00
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_capability_set);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_exec_mount_flags);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_timer);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_trigger_unit);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_path_spec);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_socket_service);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_service_sockets);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_unit_env_file);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_ip_tos);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_unit_condition_path);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_unit_condition_string);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_kill_mode);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_notify_access);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_emergency_action);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_unit_requires_mounts_for);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_syscall_filter);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_syscall_archs);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_syscall_errno);
|
2020-08-30 20:56:13 +02:00
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_syscall_log);
|
2018-05-22 13:10:17 +02:00
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_environ);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_pass_environ);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_unset_environ);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_unit_slice);
|
2018-05-29 05:57:06 +02:00
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_cg_weight);
|
2018-05-22 13:10:17 +02:00
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_cpu_shares);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_memory_limit);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_tasks_max);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_delegate);
|
2020-03-09 23:09:17 +01:00
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_managed_oom_mode);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_managed_oom_mem_pressure_limit);
|
2018-05-22 13:10:17 +02:00
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_device_policy);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_device_allow);
|
2018-06-13 23:16:35 +02:00
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_io_device_latency);
|
2018-05-22 13:10:17 +02:00
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_io_device_weight);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_io_limit);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_blockio_weight);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_blockio_device_weight);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_blockio_bandwidth);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_job_mode);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_job_mode_isolate);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_exec_selinux_context);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_exec_apparmor_profile);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_exec_smack_process_label);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_address_families);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_runtime_preserve_mode);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_exec_directories);
|
2020-07-23 08:49:52 +02:00
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_set_credential);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_load_credential);
|
2018-05-22 13:10:17 +02:00
|
|
|
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);
|
2019-11-24 14:14:43 +01:00
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_allowed_cpus);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_allowed_mems);
|
2018-05-22 13:10:17 +02:00
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_protect_home);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_protect_system);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_bus_name);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_exec_utmp_mode);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_working_directory);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_fdname);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_sec_fix_0);
|
2019-08-01 09:58:27 +02:00
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_user_group_compat);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_user_group_strv_compat);
|
2018-05-22 13:10:17 +02:00
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_restrict_namespaces);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_bind_paths);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_exec_keyring_mode);
|
2020-08-06 12:51:50 +02:00
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_protect_proc);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_proc_subset);
|
2018-05-22 13:10:17 +02:00
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_job_timeout_sec);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_job_running_timeout_sec);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_log_extra_fields);
|
2019-11-25 16:22:45 +01:00
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_log_namespace);
|
2018-05-22 13:10:17 +02:00
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_collect_mode);
|
2018-11-09 18:19:40 +01:00
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_pid_file);
|
2018-11-16 11:41:18 +01:00
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_exit_status);
|
cgroup: Add DisableControllers= directive to disable controller in subtree
Some controllers (like the CPU controller) have a performance cost that
is non-trivial on certain workloads. While this can be mitigated and
improved to an extent, there will for some controllers always be some
overheads associated with the benefits gained from the controller.
Inside Facebook, the fix applied has been to disable the CPU controller
forcibly with `cgroup_disable=cpu` on the kernel command line.
This presents a problem: to disable or reenable the controller, a reboot
is required, but this is quite cumbersome and slow to do for many
thousands of machines, especially machines where disabling/enabling a
stateful service on a machine is a matter of several minutes.
Currently systemd provides some configuration knobs for these in the
form of `[Default]CPUAccounting`, `[Default]MemoryAccounting`, and the
like. The limitation of these is that Default*Accounting is overrideable
by individual services, of which any one could decide to reenable a
controller within the hierarchy at any point just by using a controller
feature implicitly (eg. `CPUWeight`), even if the use of that CPU
feature could just be opportunistic. Since many services are provided by
the distribution, or by upstream teams at a particular organisation,
it's not a sustainable solution to simply try to find and remove
offending directives from these units.
This commit presents a more direct solution -- a DisableControllers=
directive that forcibly disallows a controller from being enabled within
a subtree.
2018-12-03 15:38:06 +01:00
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_disable_controllers);
|
2019-03-19 19:05:19 +01:00
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_oom_policy);
|
2019-03-12 18:58:26 +01:00
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_numa_policy);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_numa_mask);
|
2019-04-23 12:14:20 +02:00
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_ip_filter_bpf_progs);
|
2019-06-20 18:51:42 +02:00
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_cpu_affinity2);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_show_status);
|
2019-09-16 02:09:35 +02:00
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_status_unit_format);
|
2019-06-20 18:51:42 +02:00
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_output_restricted);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_crash_chvt);
|
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_timeout_abort);
|
2020-01-09 17:02:56 +01:00
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_swap_priority);
|
2020-07-14 17:18:41 +02:00
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_mount_images);
|
2020-10-26 17:39:14 +01:00
|
|
|
CONFIG_PARSER_PROTOTYPE(config_parse_socket_timestamping);
|
2011-08-01 00:43:05 +02:00
|
|
|
|
|
|
|
/* gperf prototypes */
|
2017-01-10 08:39:05 +01:00
|
|
|
const struct ConfigPerfItem* load_fragment_gperf_lookup(const char *key, GPERF_LEN_TYPE length);
|
2011-08-01 00:43:05 +02:00
|
|
|
extern const char load_fragment_gperf_nulstr[];
|