Sample Header Ad - 728x90

Where should non-root-user programs write the data which system-level programs write to (subdirectories of) /var?

-1 votes
1 answer
79 views
### Background Unix convention and the Linux Filesystem Hierarchy standard define several paths under which processes look for certain information, or use to write certain information. When one needs to setup a user-specific environment, as a non-root user - most of those locations are either inaccessible, or readable but without the ability to write to files or create new ones. So, one must use alternatives. In principle, we could just treat a user's home directory like another /; however, that's not common practice. There is also the custom of creating a $HOME/.my_app directory. Most apps which create those use those for configuration, but some also for other kinds of data (Eclipse, Firefox, Thunderbird come to mind as hiding gobs of data in there). But that means we may have dozens if not hundreds of .something in the home directory, which is quite unseemly. Finally, it has also become common for some apps to write into $HOME/.local and $HOME/.config, which does not "litter" the home directory itself: $HOME/.config can be seen as an equivalent of /etc and $HOME.local of /usr; so, quite useful, but - it doesn't cover /var and its subdirectories. ### Actual question Where, under a user's home directory, should we, or should a program we write, store the data which a system-level program would store in /var, or subdirectories of /var? That is to say: "files whose content is expected to continually change during normal operation of the system, such as logs [and] spool... files" (to quote the FHS), as well as cache, non-static databases, lock files, run files and log files?
Asked by einpoklum (10753 rep)
Nov 14, 2024, 04:47 PM
Last activity: Nov 14, 2024, 10:28 PM