Instead of relying on a hardcoded Ubuntu path for detecting which display manager is in use, ask systemd what it's launching in the first instance, then fallback to the old way if that's not available.
Additionally guard execution of the guest-session-toggle binary with the display manager check as it's LightDM specific and produces a load of log spam if LightDM isn't available.
Instead of relying on a hardcoded Ubuntu path for detecting which display manager is in use, ask systemd what it's launching in the first instance, then fallback to the old way if that's not available.
Additionally guard execution of the
guest-session-toggle
binary with the display manager check as it's LightDM specific and produces a load of log spam if LightDM isn't available.