MOACChain / FileStorm

25 stars 11 forks source link

scsserver-linux-amd64 does not respect path from configuration file. #6

Open wangjia184 opened 5 years ago

wangjia184 commented 5 years ago

I am tryign to dockernize filestorm so that it can be run from NAS device. Current latest version 2.0 https://github.com/MOACChain/FileStorm/releases/tag/2.0

scsserver-linux-amd64 cannot be started in docker container with non-root privilege. After further investigation, it turns out scsserver-linux-amd64 was trying to write files in the root directory.

Those files are out of /data/scs directory which is configured in userconfig.json

{
   //....
    "DataDir" : "/data/scs"
   //...
}

However, scsserver-linux-amd64 does not respect that. And encountered permission error on start.

A temporary solution is to add the following line into Dockerfile so that the working directory is fixed to /data/scs.

WORKDIR /data/scs

It seems scsserver-linux-amd64 is trying to write files in working directory instead of configured path.

fraymond commented 5 years ago

DataDir folder is only used to store block information. Folders will be add to this directory after filestorm scs has been successfully added to filestorm blockchain. The 3 files and folder you mentioned are designed to be created under root folder.

wangjia184 commented 5 years ago

The 3 files and folder you mentioned are designed to be created under root folder.

After specifying WORKDIR /data/scs, they are now created in /data/scs directory and scsserver-linux-amd64 can be started with non-root privilege.

fraymond commented 5 years ago

I'm glad you've made it work! Thanks for sharing this with us.