canonical / lightdm

Display Manager
GNU General Public License v3.0
827 stars 138 forks source link

Hang on login caused by 'df' #359

Open gcorrall opened 4 months ago

gcorrall commented 4 months ago

In debian/patches/04_language_handling.patch, a 'df' is run, to check if lightdm is running in a 'live session':

if (system ("df | grep -q ^/cow") != 0)
    session_set_env (session, "LANGUAGE", language);

(from this commit: 'Only set LANGUAGE if not in a live session'; https://github.com/canonical/lightdm/pull/111/commits/3b11df7c6461f637066e7031ad6edac398901798).

This can cause lightdm to hang when the 'df' hangs - such as when an NFS mount becomes unresponsive. I have encountered this on a machine where remote SSH users had mounted an NFS share, which later became stuck, and I was unable to login via lightdm.

Perhaps some other way of checking for the mount could be used ( grep -q "^/cow / " /proc/mounts ? ), or a timeout could be added to the 'df':

timeout 5 df | grep -q ^/cow