From c580162650a151ec02f69d7de567a79438b3f5a0 Mon Sep 17 00:00:00 2001 From: Jordan S Date: Thu, 30 May 2024 17:58:26 -0300 Subject: [PATCH] Do not pass -z into systemd systems upon init Because strange things can happen. Details here: https://github.com/systemd/systemd/issues/28184 While a systemd patch helps re-arrange arguments to work around the issue, -z isn't actually utilized by systemd, so there's no good reason to pass it. --- lib/env.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/env.c b/lib/env.c index 4eebcee..64dc917 100644 --- a/lib/env.c +++ b/lib/env.c @@ -902,7 +902,11 @@ char **makeenv(char **env, list_head_t *head) int exec_init(const struct start_param *param) { char cid[STR_SIZE]; - char *argv[] = {"init", "-z", " ", NULL}; + if (is_systemd()) + char *argv[] = {"init", NULL}; + else + char *argv[] = {"init", "-z", " ", NULL}; + char *envp[] = {"HOME=/", "TERM=linux", cid, NULL}; char **env; int errcode = 0;