In stable lightdm-1.9.5 session-cleanup scripts trigger before a session has started. Simply clicking between users at the login menu triggers the session cleanup script.
I make a mastake with version: 1.8.5.
I don't understand the problem
By manual of lightdm: session-cleanup-script: Script to run when quitting a user session (runs as root). But this script runs even when user switch. At example I have script for sync user profile to server, and this script should be run on user logout. But this script runs by lightdm clicking between users at the login menu. This problem is absent in 1.4.3 and 1.6.2 lightdm versions.
Created attachment 365216 [details, diff] Run session-cleanup-script only on logout Launch session-cleanup-script only authentificated users.
You have to submit your patch to the upstream lightdm before we can accept it in Gentoo
Also I have observed the cleanup-script launch during unlocking session by lightdm: I logged into session by lightdm, locked the session by command "dm-tool lock", unlocked the session by lightdm and I observed the launch of cleanup-script for this user.
Posted earlier patch doesn't resolve this problem.