directory /var not persistent in openwrt?

Bas Wijnen wijnen at debian.org
Tue Jun 7 16:15:26 EDT 2011


Op 07-06-11 21:53, David Kuehling schreef:
> for the "alex4" port I configured the game to write save-data and score
> data to /var .
> 
> Now I just realized that /var is a tmpfs that looses all data after
> reboot.
> 
> Is that really intended?  Where would I then write save-data to?
> /usr/share?  /etc?

I would expect any program to write only to places where the user
executing the program would normally have write access. A game should
not normally be run as root, which means it should really only write to
the home directory or subdirectories of it.

The only exception is a centralized high score file, but on the Ben we
don't have multiple users, so that's a non-issue.

Following the xdg base directory specification you should use:
$HOME/.local/share for data (saves and score are both data)
$HOME/.config for configuration
$HOME/.cache for regeneratable data

All data should be in a subdir in there. So for alex4, you should use
$HOME/.local/share/alex4/

Source:
http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html

Thanks,
Bas




More information about the discussion mailing list


interactive