elcook

Yet another configuration problem

Recommended Posts

I have been trying to run resilio-sync as a personal backup cloud for my phone for a few weeks, using a raspberry pi 2 and an external HDD.

I've installed following the instructions here:

https://www.resilio.com/blog/official-linux-packages-for-sync-now-available

and made sure I enabled automatic startup with:

sudo systemctl enable resilio-sync

no problems so far, until I try to acess the webgui and setup my folders in the HDD (permission error)

 

So I edited the file in /etc/resilio-sync/config.json and added the line

"directory_root" : "/pathtodrive",

I stopped the service, and used the config file with:

sudo rslsync --config /etc/resilio-sync/config.json

At that time everything looks fine and I can add my folders without any problem.

 

Unfortunately, whenever I reboot the pi, or it gets powered down, I always need to stop the service and point it to the config file on reboot, because the configurations get "lost" somehow. My directory_root folder disappers from the preferences in the webgui, and the folders I setup are not longer there.

 

Shouldn't my configurations be used everytime the service starts? Why do I always have to configure sync manually? I think I'm missing something.

 

This is my status report BTW:

sudo service resilio-sync status
● resilio-sync.service - Resilio Sync service
   Loaded: loaded (/lib/systemd/system/resilio-sync.service; enabled)
   Active: active (running) since Mon 2017-01-02 23:14:15 GMT; 8h ago
     Docs: http://help.getsync.com/
  Process: 577 ExecStart=/usr/bin/rslsync --config /etc/resilio-sync/config.json (code=exited, status=0/SUCCESS)
  Process: 571 ExecStartPre=/bin/chown -R rslsync:rslsync /var/run/resilio-sync (code=exited, status=0/SUCCESS)
  Process: 561 ExecStartPre=/bin/mkdir -p /var/run/resilio-sync (code=exited, status=0/SUCCESS)
 Main PID: 657 (rslsync)
   CGroup: /system.slice/resilio-sync.service
           └─657 /usr/bin/rslsync --config /etc/resilio-sync/config.json

Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.

 

I've been trying to solve this for weeks now...

Share this post


Link to post
Share on other sites

The root cause is the same - Sync will "loose configuration" if it starts with new or different storage. 

Not sure why you started sync binary manually after editing config, instead of just launching the service, but check and show:
1) content of /etc/resilio-sync/config.json
2) check running processes (grepped by rslsync) and see with which user they run and what exactly config they use. 

Share this post


Link to post
Share on other sites

Hi Helen,

Thanks for your reply.

The first time I edited the config file, I just rebooted the rspi in the hopes that sync would launch on reboot with the right config. That did not happen, but I found that stoping the service and launching it manually would allow me to add the folders in my disk. Of course, launching the service manually does not fit the purpose.

 

Here's the content of the config file: 

cat /etc/resilio-sync/config.json

{
    "storage_path" : "/var/lib/resilio-sync/",
    "pid_file" : "/var/run/resilio-sync/sync.pid",
    "directory_root" : "/media/pi/HDD",
    "webui" :
    {
        "listen" : "MYip:8888"
    }
}

And the running processes.

ps -ef | grep rslsync

rslsync    652     1  0 15:16 ?        00:00:00 /usr/bin/rslsync --config /etc/resilio-sync/config.json

pi        1474   754  1 15:18 ?        00:00:00 /usr/bin/rslsync --config /home/pi/.config/resilio-sync/config.json

pi        1477  1184  0 15:18 pts/0    00:00:00 grep --color=auto rslsync

 

Should there be two instances of rslsync running under two different users??? 

Share this post


Link to post
Share on other sites
23 hours ago, elcook said:

Should there be two instances of rslsync running under two different users??? 

Well, once you've launched Sync to run with two users - root and the user, then it should. 
So I'm not sure which Sync's UI you actually open, each of them will be using a different storage and different settings.. Better kill unwanted process and use only one of them to avoid that confusion. 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.