moosefs / moosefs-docker-cluster

Multiple node MooseFS cluster on Docker
https://moosefs.com
GNU General Public License v2.0
77 stars 27 forks source link

Custom /etc/mfs/mfshdd.cfg is always overwritten in chunkserver.sh #20

Closed toomyem closed 1 year ago

toomyem commented 1 year ago

Custom defined mfshdd.cfg file (set via $MFS_HDD_CONFIG) is always overwritten by "add size part" of the chunkserver.sh script (regardless if $SIZE is set of not). There probably should be "else if" statement, something like this:

# Overwrite mfshdd.cfg if passed in
# this will base64 decode MFS_HDD_CONFIG variable text
# substitute any env variables in decoded text
# save text into /etc/mfs/mfshdd.cfg
if [ ! -z ${MFS_HDD_CONFIG+X} ];
    then
        echo $MFS_HDD_CONFIG | base64 -d | envsubst > /etc/mfs/mfshdd.cfg
elif [ -z ${SIZE+X} ]; #Add size to hdd if defined
    then
        echo "/mnt/hdd0" > /etc/mfs/mfshdd.cfg
    else
        echo "/mnt/hdd0 ${SIZE}GiB" > /etc/mfs/mfshdd.cfg
fi