diff --git a/man/systemd.exec.xml b/man/systemd.exec.xml
index daa2a595f0..e696941682 100644
--- a/man/systemd.exec.xml
+++ b/man/systemd.exec.xml
@@ -3755,6 +3755,15 @@ StandardInputData=V2XigLJyZSBubyBzdHJhbmdlcnMgdG8gbG92ZQpZb3Uga25vdyB0aGUgcnVsZX
system.
+
+ $REMOTE_ADDR
+ $REMOTE_PORT
+
+ If this is a unit started via per-connection socket activation (i.e. via a socket
+ unit with Accept=yes), these environment variables contain the IP address and
+ port number of the remote peer of the socket connection.
+
+
$TRIGGER_UNIT
$TRIGGER_PATH
diff --git a/src/core/manager.c b/src/core/manager.c
index 380a4e30d7..5c8c417dae 100644
--- a/src/core/manager.c
+++ b/src/core/manager.c
@@ -635,8 +635,14 @@ static char** sanitize_environment(char **l) {
"LISTEN_FDS",
"LISTEN_PID",
"LOGS_DIRECTORY",
+ "LOG_NAMESPACE",
"MAINPID",
"MANAGERPID",
+ "MONITOR_EXIT_CODE",
+ "MONITOR_EXIT_STATUS",
+ "MONITOR_INVOCATION_ID",
+ "MONITOR_SERVICE_RESULT",
+ "MONITOR_UNIT",
"NOTIFY_SOCKET",
"PIDFILE",
"REMOTE_ADDR",
@@ -644,6 +650,11 @@ static char** sanitize_environment(char **l) {
"RUNTIME_DIRECTORY",
"SERVICE_RESULT",
"STATE_DIRECTORY",
+ "SYSTEMD_EXEC_PID",
+ "TRIGGER_PATH",
+ "TRIGGER_TIMER_MONOTONIC_USEC",
+ "TRIGGER_TIMER_REALTIME_USEC",
+ "TRIGGER_UNIT",
"WATCHDOG_PID",
"WATCHDOG_USEC",
NULL);
@@ -660,13 +671,11 @@ int manager_default_environment(Manager *m) {
m->transient_environment = strv_free(m->transient_environment);
if (MANAGER_IS_SYSTEM(m)) {
- /* The system manager always starts with a clean
- * environment for its children. It does not import
- * the kernel's or the parents' exported variables.
+ /* The system manager always starts with a clean environment for its children. It does not
+ * import the kernel's or the parents' exported variables.
*
- * The initial passed environment is untouched to keep
- * /proc/self/environ valid; it is used for tagging
- * the init process inside containers. */
+ * The initial passed environment is untouched to keep /proc/self/environ valid; it is used
+ * for tagging the init process inside containers. */
m->transient_environment = strv_new("PATH=" DEFAULT_PATH);
if (!m->transient_environment)
return log_oom();
@@ -685,7 +694,6 @@ int manager_default_environment(Manager *m) {
}
sanitize_environment(m->transient_environment);
-
return 0;
}