I have a systemd service on a Raspberry Pi that reads the configuration from EEPROM and parses it to .env
format. Other programs will then parse it easily later. I assume that the EEPROM variable has to be read and parsed every time the system boots and that the .env
file needs to be removed every time the system is shut down.
My problem is where to put the .env
file. I considered using the /tmp
directory, but it is intended for files to be present only as long as the application is running. Next, I thought of using /run
, but from what I have read, it is meant for locks and PID. This is also the case for all the variations of /var/tmp
. Finally, I am thinking of storing it in /etc/my_app
and then using the tmpfiles.d
routine to clean it every time the system boots up.
The file serves the purpose for both systemd routines and later for user applications.
The question was first asked on StackOverflow, and I was redirected here.