Bug #5344
open
NLSR should not write nlsrSeqNo.txt in the home directory
Added by Davide Pesavento about 1 month ago.
Updated 29 days ago.
Description
It's bad etiquette. FHS defines /var/lib
as the directory to hold application state information. Furthermore, XDG defines $XDG_STATE_HOME
for similar purposes, with a default value of $HOME/.local/state
. When running as a systemd service, we should also consider honoring the $STATE_DIRECTORY
env variable.
I just remembered that nlsr.conf
has a mandatory state-dir
setting. So I guess the $HOME
logic is only used as a fallback? But what's the point of a fallback if the setting is mandatory?
That being said, this bug is still valid because when I run the unit tests, a nlsrSeqNo.txt
file appears in my home directory. That should not happen.
Davide Pesavento wrote in #note-1:
I just remembered that nlsr.conf
has a mandatory state-dir
setting. So I guess the $HOME
logic is only used as a fallback? But what's the point of a fallback if the setting is mandatory?
That being said, this bug is still valid because when I run the unit tests, a nlsrSeqNo.txt
file appears in my home directory. That should not happen.
From looking at the tests, my understanding is that ConfParam objects will default the state directory value to a null string, ergo failing over to $HOME
and leaving stray files. I think the question then arises of if we should default to the home directory at all, or instead use /tmp
like the unit tests for the SequencingManager tests.
Also available in: Atom
PDF