data: Only unset environment when the service actually ran

ExecStopPost= is executed even if ExecCondition= fails. As such, we need
to add a guard as we would otherwise clear environment variables on X11
sessions (rendering them utterly useless).

https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1418
This commit is contained in:
Benjamin Berg 2020-08-20 10:08:01 +02:00 committed by Benjamin Berg
parent b80b22e78d
commit 56b6e65317

View File

@ -26,7 +26,7 @@ ExecStart=@bindir@/gnome-shell
SuccessExitStatus=1 SuccessExitStatus=1
# unset some environment variables that were set by the shell and won't work now that the shell is gone # unset some environment variables that were set by the shell and won't work now that the shell is gone
ExecStopPost=-systemctl --user unset-environment GNOME_SETUP_DISPLAY WAYLAND_DISPLAY DISPLAY XAUTHORITY ExecStopPost=-/bin/sh -c 'test "$SERVICE_RESULT" != "exec-condition" && systemctl --user unset-environment GNOME_SETUP_DISPLAY WAYLAND_DISPLAY DISPLAY XAUTHORITY'
# On wayland we cannot restart # On wayland we cannot restart
Restart=no Restart=no