From 82f306321808cac966e9bde20d3012a6ba9924bb Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 19 Feb 2021 17:48:50 +0100 Subject: [PATCH 1/2] manager: taint systemd if cgroupsv1 is used let's mark cgroupsv1 systems as "tainted" in the taint string logic. It's time. --- src/core/manager.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/core/manager.c b/src/core/manager.c index f6936bedd4..d8f80a5536 100644 --- a/src/core/manager.c +++ b/src/core/manager.c @@ -4799,6 +4799,7 @@ char *manager_taint_string(Manager *m) { buf = new(char, sizeof("split-usr:" "cgroups-missing:" + "cgrousv1:" "local-hwclock:" "var-run-bad:" "overflowuid-not-65534:" @@ -4815,6 +4816,9 @@ char *manager_taint_string(Manager *m) { if (access("/proc/cgroups", F_OK) < 0) e = stpcpy(e, "cgroups-missing:"); + if (cg_all_unified() == 0) + e = stpcpy(e, "cgroupsv1:"); + if (clock_is_localtime(NULL) > 0) e = stpcpy(e, "local-hwclock:"); From 5cfbe7452f023fc307374f306e26b5ee902889f0 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Fri, 19 Feb 2021 17:49:44 +0100 Subject: [PATCH 2/2] man: emphasize a bit more that PID files suck --- man/systemd.service.xml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/man/systemd.service.xml b/man/systemd.service.xml index 25cca3d8d6..0e9fa3e732 100644 --- a/man/systemd.service.xml +++ b/man/systemd.service.xml @@ -292,7 +292,11 @@ will remove the file after the service has shut down if it still exists. The PID file does not need to be owned by a privileged user, but if it is owned by an unprivileged user additional safety restrictions are enforced: the file may not be a symlink to a file owned by a different user (neither directly nor indirectly), and the - PID file must refer to a process already belonging to the service. + PID file must refer to a process already belonging to the service. + + Note that PID files should be avoided in modern projects. Use or + where possible, which does not require use of PID files to determine the + main process of a service and avoids needless forking.