From: Kamalesh Babulal Date: Sun, 19 Nov 2023 08:44:57 +0000 (+0530) Subject: tools/cgexec: guard systemd default delegate slice X-Git-Tag: v3.2.0~171 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=49c65117d247e9697b19d6847df5678f6c27ea0f;p=thirdparty%2Flibcgroup.git tools/cgexec: guard systemd default delegate slice Guard setting default systemd delegate slice with WITH_SYSTEMD, to limit the systemd delegation only to --enable-systemd=yes only. Signed-off-by: Kamalesh Babulal Signed-off-by: Tom Hromatka --- diff --git a/src/tools/cgexec.c b/src/tools/cgexec.c index ba8b8b95..10b88c20 100644 --- a/src/tools/cgexec.c +++ b/src/tools/cgexec.c @@ -70,7 +70,9 @@ static void usage(int status, const char *program_name) int main(int argc, char *argv[]) { struct cgroup_group_spec *cgroup_list[CG_HIER_MAX]; +#ifdef WITH_SYSTEMD int ignore_default_systemd_delegate_slice = 0; +#endif pid_t scope_pid = -1; int child_status = 0; int replace_idle = 0; @@ -129,9 +131,10 @@ int main(int argc, char *argv[]) return ret; } - /* this is false always for disable-systemd */ +#ifdef WITH_SYSTEMD if (!ignore_default_systemd_delegate_slice) cgroup_set_default_systemd_cgroup(); +#endif /* Just for debugging purposes. */ uid = geteuid();