ReGreet icon indicating copy to clipboard operation
ReGreet copied to clipboard

Should `/var/cache/regreet/cache.toml` be moved to `/var/lib/regreet/state.toml`?

Open Rosuavio opened this issue 2 years ago • 5 comments
trafficstars

I have been investigating what directories are safe/inconsequential to have on a tmpfs, and the docs I am finding around FHS point toward the files in /var/cache being very safe to delete with the largest resulting consistences being that programs would have to take time to recompute the data. Deleting /var/cache/regreet/state.toml will "lose" in-recalculate-able values that will require user input to re-obtain. Also deleting the file will have the very visible consistences to the user.

Since the file is more state-full maybe it should live under /var/lib/ is some form?

https://www.pathname.com/fhs/pub/fhs-2.3.html#VARCACHEAPPLICATIONCACHEDATA https://tldp.org/LDP/Linux-Filesystem-Hierarchy/html/var.html

Rosuavio avatar Jul 12 '23 06:07 Rosuavio

While the lost values are technically incalculable, they only serve as a minor convenience, and ReGreet is perfectly usable if it's deleted. Is the requirement for being able to recreate the cache actually necessary? The second link doesn't suggest that.

rharish101 avatar Jul 12 '23 15:07 rharish101

That's a fair point, but at the same time the docs for /var/lib don't seem to specify that the state information stored there needs to be considered essential for the operation of the program, or if it's safer to delete or not. So /var/lib seems equally or more appropriate for this data as it's less prescriptive on being able to recalculate its contents while saying it's a place specifically for application state information (which seems to be the contents of the file).

Rosuavio avatar Jul 12 '23 16:07 Rosuavio

This link may be more official and it specifies...

The application must be able to regenerate or restore the data. Unlike /var/spool, the cached files can be deleted without data loss.

Deleting that file would have a noticeable impact, so I would consider deleting it "data loss"

Rosuavio avatar Jul 12 '23 17:07 Rosuavio

If changing the default is desirable I can make a PR when I have an opportunity.

Rosuavio avatar Jul 12 '23 17:07 Rosuavio

Okay then, go ahead!

rharish101 avatar Jul 12 '23 18:07 rharish101