]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
core: warn on ExitType=cgroup with legacy cgroup setup
authorLuca Boccassi <luca.boccassi@microsoft.com>
Tue, 1 Feb 2022 15:31:52 +0000 (15:31 +0000)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 1 Feb 2022 22:07:47 +0000 (07:07 +0900)
'cgroup empty' notifications are not reliable on v1, so log a warning.

See: https://github.com/systemd/systemd/issues/22320

src/core/service.c

index 905558af57c1522c25928f84a3d301f254cf36e8..c767a38b290311ffde38e445c24a6e73e448b905 100644 (file)
@@ -624,6 +624,9 @@ static int service_verify(Service *s) {
         if (s->runtime_max_usec == USEC_INFINITY && s->runtime_rand_extra_usec != 0)
                 log_unit_warning(UNIT(s), "Service has RuntimeRandomizedExtraSec= setting, but no RuntimeMaxSec=. Ignoring.");
 
+        if (s->exit_type == SERVICE_EXIT_CGROUP && cg_unified() < CGROUP_UNIFIED_SYSTEMD)
+                log_unit_warning(UNIT(s), "Service has ExitType=cgroup set, but we are running with legacy cgroups v1, which might not work correctly. Continuing.");
+
         return 0;
 }