Julianno

Run Resilio Sync Service as root (linux)

Recommended Posts

Hello, I´ve installed Resilio Sync using the below link. I did the basic configuration and I can access the 8888 webgui successfully. The local user created is rslsync (with group same name), that is different from the Web Gui user.

The server I installed Resilio, is a production CPANEL server, and the idea is to have all Cpanel accounts and server configs backed up in another location (sync´d), without the need to use CPANEL backup function (that does not support syncing yet)

The problem is that resilio sync can´t access each account of Cpanel (folders and subfolders), nor server configurations as it have their own user/group for each account in system. I don´t want to change each folder permissions with chmod with risk to brake CPANEL.

So, based on all this. How to run Resilio (service in linux) as root, and/or have automatically access to all folders in CenOS 6 server, without compromising CPANEL system/server?

Thanks in advance!

Installation link: https://help.resilio.com/hc/en-us/articles/206178924-Installing-Sync-package-on-Linux

Share this post


Link to post
Share on other sites

Helen, thank you for your reply. I did what you said. 

This is how my resilio.sync.service is now, after the change:

[Unit]
Description=Resilio Sync service
Documentation=https://help.getsync.com/
After=network.target

[Service]
Type=forking
User=root
Group=root
UMask=0002
Restart=on-failure
PermissionsStartOnly=true
PIDFile=/var/run/resilio-sync/sync.pid
ExecStartPre=/bin/mkdir -p /var/run/resilio-sync
ExecStartPre=/bin/chown -R root:root /var/run/resilio-sync
ExecStart=/usr/bin/rslsync --config /etc/resilio-sync/config.json

[Install]
WantedBy=default.target


Also did a restart at its service and CentOS6 before test it again into Web Gui.

Still can´t acess all folders of server. It says "Its not possible to open destination folder". 

Any lights?

Thank you in advance

 

Share this post


Link to post
Share on other sites

how's hd2 mounted - what are the parameters? 
do you see this error for other directories? 
In Terminal, can you do the listing of /mnt/hd2 without any error output? 

You have only one Sync running, and it's definitely running as root (checked with ps). Correct? 

Share this post


Link to post
Share on other sites

here is how the /mnt/hd2 is mounted in etc/fstab:

"/dev/vdb        /mnt/hd2        ext4    auto,rw,usrjquota=quota.user,jqfmt=vfsv0"

PS listing of sync:

root@netvolt [/mnt/hd2]# ps aux|grep sync|grep -v grep
root        22  0.0  0.0      0     0 ?        S    Oct10   0:00 [async/mgr]
root        24  0.0  0.0      0     0 ?        S    Oct10   0:24 [sync_supers]
rslsync  14606  0.3  0.1 749856  5632 ?        Ssl  Oct20  13:29 /usr/bin/rslsync --config /etc/resilio-sync/config.json
root@netvolt [/mnt/hd2]#
 

- Yes, root can list all folders without problem in SSH;

- Resilio Web Gui also have same error to list "/home/some_accounts" but not all of them. Some are inside this folder, and some are linked to mnt/hd2

 

Share this post


Link to post
Share on other sites
29 minutes ago, Julianno said:

rslsync  14606  0.3  0.1 749856  5632 ?        Ssl  Oct20  13:29 /usr/bin/rslsync --config /etc/resilio-sync/config.json

Sync here runs as rslsync, not root. Thus - no permissions to access the folder. 

Share this post


Link to post
Share on other sites

I did change the resilio.sync.service as you said in the tread. Is there another code that I need to run in order to change the ownership of this app to root?

Thanks

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now