1

I would previously just use /tmp however this seems to persist after boot, it also seems to be have the disadvantage about literally writing to the disk as opposed to a ramdisk / tmpfs.

I thought perhaps /run/ but this seems (at least on my Nixos system) to be owned by the root user.

Is there any recommended directory for this use case?

1 Answer 1

2

On any systemd-based system, the location matching your requirements most closely is your subdirectory of /run/user, or rather, the directory indicated by $XDG_RUNTIME_DIR. This is flushed whenever the owning user session stops (typically, when the user logs out).

As far as the FHS goes, it doesn’t specify storage properties apart from durability; the appropriate location according to that is /tmp.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .