Comment 0 for bug 1800277

Revision history for this message
James Hunt (jamesodhunt) wrote :

= Problem =

It is too easy to make a system unusable.

= Examples

The following commands will all cause subsequent graphical logins to fail:

== User is returned to login screen ==

- chmod 400 ~/.ICEauthority
- rm ~/.ICEauthority

In this scenario, the user is returned to the login screen with no indication of what went wrong.

== Session "dead" ==

- chmod 444 ~/.cache
- chmod 000 ~/.config
- chmod 444 ~
- chmod 000 ~

In this scenario, the system just freezes: the cursor is unresponsive and users will be reaching for the power button.

= Observation =

These scenarios would all be caused by human error.

However, clearly it is possible for the system to detect such issues and either alert the user to the problem or simply just fix the problem. This does not happen in Ubuntu 18.04 LTS though.

= Idea =

Have the display manager call a utility prior to executing the users preferred session. This utility -- which could be a simple shell script I think ("friendly-session-fixer" maybe? :) -- would do one or both of the following:

- Perform checks for the issues outlined above warn the user graphically if any are found.

- Fix any issues found to allow the user to login.

However they are treated, all issues should also be logged in the journal (could be the user journal, but the system journal may be best to allow admins to spot such issues being detected more easily?)

= Rationale =

1) All the problems above, although user-generated, are:

- trivially fixable.
- potentially very hard / impossible for a naeve user to debug and resolve.

2) By handling such errors, users won't have a bad experience of Linux if they inadvertently perturb a critical file.

3) Users will not need to resort to a re-install (which I can imagine some may have to given the current behaviour).

= Ideas for further checks =

- Check to ensure key files exist and if not, copy them in from /etc/skel/, etc.
- Check to ensure users home directory is owned by them and not root, etc.
- If the home partition / disk is 100% full, the script could logrotate and compress the contents of ~/.cache/ ?

= Notes =

You could argue that the session managers themselves should deal with these issues. In some cases that may be a fair comment. However, by having a single central check/fix script, the problems can be handled centrally without the issue whereby some session managers tolerate certain scenarios whereas others don't.