}
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) {
- error_message = "Failed to mount cgroup v1 hierarchy";
+ 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. */
if (!cg_is_legacy_wanted())
return 0;
+ if (!cg_is_legacy_force_enabled())
+ return -ERFKILL;
+
FOREACH_ARRAY(mp, cgroupv1_mount_table, ELEMENTSOF(cgroupv1_mount_table)) {
r = mount_one(mp, loaded_policy);
if (r < 0)