bobafetthotmail / folder2ram

mount those folders to ram without losing access to their counterpart on disk!
GNU General Public License v3.0
110 stars 21 forks source link

Configuration ignored if spaces are used instead of tabs #26

Open arkhipenko-blade opened 1 year ago

arkhipenko-blade commented 1 year ago

When populating /etc/folder2ram/folder2ram.conf with

tmpfs<tab><tab>/var/log

everything works fine.

When

tmpfs<space><space><space><space><space><space><space><space>/var/log

as if configuration wasn't there - just ignored.

Probably should not differentiate btw spaces and tabs so much?

Thank you!

bobafetthotmail commented 1 year ago

tl;dr yes it's a known limitation. I never invested the time to do better parsing of the config file so you MUST use 2 tabs to separate the columns

It's stated in the comments when you create a config file (see the "IMPORTANT" part). I'm sure it's possible to fix this but I never cared enough to do it.

I assume you are using folder2ram in OMV or another project that overwrites the config file with its own so the comments are deleted. If that is the case you probably need to ask them to document this or leave the comment in the file.

#############################
#folder2ram main config file#
#############################
#
#PROTIP: to make /var/lock or /tmp available as ram filesystems,
#        it is preferable to set the variables RAMTMP, RAMLOCK
#        in /etc/default/tmpfs.
#
#TYPE: options available are "tmpfs" (for a ram folder)
#
#OPTIONS: mount option (will be passed as options to mount), if left blank "defaults" will be used
#
#TIMEOUT=2m #write here the timeout limit for folder2ram service activity
#           #(the time specified here must cover the mount/unmount time of all folders)
#           #if you are using systemd init, when you change this value you must run
#           #folder2ram -enablesystemd again to update the systemd service units with the new value 
#
#IMPORTANT: use 2 Tabs to separate "type" from "mount point" from "options", the script needs them to read correctly the configuration.
#
#<type>     <mount point>           <options>
#tmpfs      /var/log