summaryrefslogtreecommitdiffstats
path: root/src/core/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/main.c')
-rw-r--r--src/core/main.c30
1 files changed, 21 insertions, 9 deletions
diff --git a/src/core/main.c b/src/core/main.c
index d5c3bf0e46..07ec98252e 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -666,7 +666,7 @@ static int parse_config_file(void) {
{ "Manager", "CPUAffinity", config_parse_cpu_affinity2, 0, &arg_cpu_affinity },
{ "Manager", "NUMAPolicy", config_parse_numa_policy, 0, &arg_numa_policy.type },
{ "Manager", "NUMAMask", config_parse_numa_mask, 0, &arg_numa_policy },
- { "Manager", "JoinControllers", config_parse_warn_compat, DISABLED_CONFIGURATION, NULL },
+ { "Manager", "JoinControllers", config_parse_warn_compat, DISABLED_LEGACY, NULL },
{ "Manager", "RuntimeWatchdogSec", config_parse_watchdog_sec, 0, &arg_runtime_watchdog },
{ "Manager", "RuntimeWatchdogPreSec", config_parse_watchdog_sec, 0, &arg_pretimeout_watchdog },
{ "Manager", "RebootWatchdogSec", config_parse_watchdog_sec, 0, &arg_reboot_watchdog },
@@ -2203,9 +2203,9 @@ static void log_execution_mode(bool *ret_first_boot) {
/* Let's check whether we are in first boot. First, check if an override was
* specified on the kernel command line. If yes, we honour that. */
- r = proc_cmdline_get_bool("systemd.condition-first-boot", /* flags = */ 0, &first_boot);
+ r = proc_cmdline_get_bool("systemd.condition_first_boot", /* flags = */ 0, &first_boot);
if (r < 0)
- log_debug_errno(r, "Failed to parse systemd.condition-first-boot= kernel command line argument, ignoring: %m");
+ log_debug_errno(r, "Failed to parse systemd.condition_first_boot= kernel command line argument, ignoring: %m");
if (r > 0)
log_full(first_boot ? LOG_INFO : LOG_DEBUG,
@@ -2291,12 +2291,6 @@ static int initialize_runtime(
install_crash_handler();
if (!skip_setup) {
- r = mount_cgroup_controllers();
- if (r < 0) {
- *ret_error_message = "Failed to mount cgroup hierarchies";
- return r;
- }
-
/* Pull credentials from various sources into a common credential directory (we do
* this here, before setting up the machine ID, so that we can use credential info
* for setting up the machine ID) */
@@ -3023,6 +3017,24 @@ int main(int argc, char *argv[]) {
goto finish;
}
+ if (!skip_setup) {
+ /* Before we actually start deleting cgroup v1 code, make it harder to boot
+ * in cgroupv1 mode first. See also #30852. */
+
+ r = mount_cgroup_legacy_controllers(loaded_policy);
+ if (r < 0) {
+ if (r == -ERFKILL)
+ error_message = "Refusing to run under cgroup v1, SYSTEMD_CGROUP_ENABLE_LEGACY_FORCE=1 not specified on kernel command line";
+ else
+ error_message = "Failed to mount cgroup v1 hierarchy";
+ goto finish;
+ }
+ if (r > 0) {
+ log_full(LOG_CRIT, "Legacy cgroup v1 support selected. This is no longer supported. Will proceed anyway after 30s.");
+ (void) usleep_safe(30 * USEC_PER_SEC);
+ }
+ }
+
/* The efivarfs is now mounted, let's lock down the system token. */
lock_down_efi_variables();