chiark / gitweb /
core: clean up environment block for --user instances a bit
[elogind.git] / src / core / manager.c
index a80d6a161ae58baf33a53066be254a934af3b7af..91c3d59d2b1f75394f119e1b956b85c292fe5f42 100644 (file)
@@ -348,11 +348,25 @@ static int manager_default_environment(Manager *m) {
 
                 /* Import locale variables LC_*= from configuration */
                 locale_setup(&m->environment);
-        } else
+        } else {
                 /* The user manager passes its own environment
                  * along to its children. */
                 m->environment = strv_copy(environ);
 
+                /* Let's remove some environment variables that we
+                 * need ourselves to communicate with our clients */
+                strv_env_unset_many(
+                                m->environment,
+                                "NOTIFY_SOCKET",
+                                "MAINPID",
+                                "MANAGERPID",
+                                "LISTEN_PID",
+                                "LISTEN_FDS",
+                                "WATCHDOG_PID",
+                                "WATCHDOG_USEC",
+                                NULL);
+        }
+
         if (!m->environment)
                 return -ENOMEM;