Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to add /tmp to PATH_DISK #146

Open
ronfischler opened this issue Jan 22, 2021 · 5 comments
Open

Unable to add /tmp to PATH_DISK #146

ronfischler opened this issue Jan 22, 2021 · 5 comments

Comments

@ronfischler
Copy link

/tmp seemed like a good candidate to add to the log2ram service, so I thought I would try this in /etc/log2ram.conf:
PATH_DISK="/var/log;/tmp"

log2ram is then unable to create /hdd.log and fails to start.

@azlux
Copy link
Owner

azlux commented Jan 22, 2021

Did you check if your system have already a tmpfs set for /tmp ?
You don't need log2ram for this folder. /tmp is used for temporary files only.

@ronfischler
Copy link
Author

No, I don't have a tmpfs set for /tmp. You are probably right though; I don't need log2ram for /tmp, I just wanted to try minimizing write ops to my SD card I am using with my RPI. I am simply surprised it doesn't work for this folder.

@ronfischler
Copy link
Author

ronfischler commented Jan 22, 2021

Looking at the log2ram script, I think the issue is on line 87: PATH_LAST_PART="${i##/*/}"

When iterating over $PATH_DISK, this line does not have the desired result when $i is a folder in the root dir. I will fiddle with the assignment made to $PATH_LAST_PART and see if I can make it work for folders such as /tmp.

Edit: actually, would this be acceptable: PATH_LAST_PART=`basename "$i"`

@azlux
Copy link
Owner

azlux commented Apr 23, 2021

I don't remember why I didn't used basename. I need to check #SlowAnswer

@dolorosus
Copy link

If you really want to add a folder in root dir you can use //foldername.
E.G. PATH_DISK="/var/log;//tmp"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants