apognu / tuigreet

Graphical console greeter for greetd
GNU General Public License v3.0
992 stars 45 forks source link

Files in /var/cache/tuigreet should be in /var/lib/tuigreet #162

Open Rosuavio opened 4 weeks ago

Rosuavio commented 4 weeks ago

After deleting /var/cache tuigreet does not remember user or user session.

To Reproduce Steps to reproduce the behavior:

  1. Run tuigreet
  2. Select session
  3. Select user
  4. login
  5. Delete /var/cache
  6. Close session
  7. See tuigreet not defaulting user and user session

Expected behavior When /var/cache is deleted tuigreet does not forget last selected user and user session.

System information:

Additional context I know this happens because tuigreet stores the last loged-in user and the users last session in /var/cache/tuigreet (as well as other information). My reasoning for this being a bug is that is is my understanding that /var/cache is intended to be used for programs to cache data that could otherwise be regenerated or restored (source). User selections cannot be regenerated by the tuigreet, but have to be provided by the user to tuigreet.

The I also consider this a bug because my expectation is that I can delete /var/cache manually as the system administrator and expect applications to able to recover any data they need independently (as explained in the same source).

In my systems I use a technique known in the NixOS community from this blog post and the impermanence tool, to erase non-specified system directories on every boot. While

I can simply enable persisting /var/cache/tuigreet but, I think many (if not all) of the files that tuigreet stores in /var/cache/tuigreet should be storied in /var/lib/tuigreet (source).