bus: Clear INVOCATION_ID when carrying out traditional activation

We weren't sure whether this one should be inherited or not, so I
asked on systemd-devel, and Lennart thought it shouldn't.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=104641
Reviewed-by: Philip Withnall <withnall@endlessm.com>
This commit is contained in:
Simon McVittie 2018-03-20 12:33:51 +00:00
parent b6b3348596
commit 66246fff2a

View file

@ -862,7 +862,6 @@ populate_environment (BusActivation *activation)
* - TERM, WATCHDOG_*: Should not be set for dbus-daemon, so not applicable
* - MAINPID, SERVICE_RESULT, EXIT_CODE, EXIT_STATUS: Not set for ExecStart,
* so not applicable
* - INVOCATION_ID: TODO: Do we want to clear this or not? It isn't clear.
*/
/* We give activated services their own Journal stream to avoid their
@ -878,6 +877,13 @@ populate_environment (BusActivation *activation)
* (and NotifyAccess wouldn't let it write here anyway) */
_dbus_hash_table_remove_string (activation->environment, "NOTIFY_SOCKET");
/* This identifies the dbus-daemon invocation. Whether it should be
* inherited by "smaller" services isn't entirely clear-cut, but not
* inheriting it makes traditional D-Bus activation under systemd a
* little more consistent with systemd activation.
* https://lists.freedesktop.org/archives/systemd-devel/2018-March/040467.html */
_dbus_hash_table_remove_string (activation->environment, "INVOCATION_ID");
return retval;
}