Reco-X

Not working in Ubuntu 16.0, Service start but doesnt work

Recommended Posts

Hello, I have a problem with rslsync basically I try to fix it since uninstalling it and trying doing a fresh install, try to modify the parameters in conf file, and also see and learn about service , upstart and so on.
Basically if I write this command:

service resilio-sync start

the message I have its this:

Starting Resilio Sync

But this doest start any process.

If I write this command:
rslsync

I have this message:

By using this application, you agree to our Privacy Policy, Terms of Use and End User License Agreement.
https://www.getsync.com/legal/privacy
https://www.getsync.com/legal/terms-of-use
https://www.getsync.com/legal/eula

Resilio Sync forked to background. pid = 16428

 

But my problem is when I try to go to the GUI  in the browser it doesnt work, http://ip:8888/

This is my conf file.

I dont know for example if the path of PID file is correct, but i dont think it the source of my problem


{
   "device_name": "Seedbox",
// "listening_port" : 0, // 0 - randomize port

/* storage_path dir contains auxilliary app files if no storage_path field: .sync dir created in current working directory */
"storage_path" : "/root/rslsync-config",

/* set location of pid file */
// "pid_file" : "/var/run/resilio/resilio.pid",

/* use UPnP for port mapping */
  "use_upnp" : true,

/* limits in kB/s. 0 - no limit */
  "download_limit" : 0,
  "upload_limit" : 0,

/* proxy configuration */
// "proxy_type" : "socks4", // Valid types: "socks4", "socks5", "http_connect". Any other value means no proxy
// "proxy_addr" : "192.168.1.2", // IP address of proxy server.
// "proxy_port" : 1080,
// "proxy_auth" : false, // Use authentication for proxy. Note: only username/password for socks5 (RFC 1929) is supported, and it is not really secure
// "proxy_username" : "user",
// "proxy_password" : "password",

/* directory_root path defines where the WebUI Folder browser starts (linux only). Default value is / */
//  "directory_root" : "/home/",

/* directory_root_policy defines how directory_root is used (linux only).
   Valid values are:
     "all" - accepts directory_root and its subdirectories for 'getdir' and 'adddir' actions
     "belowroot" - accepts directory_root's subdirectories for 'getdir' and 'adddir' actions,
      but denies attempts to use 'adddir' to create directories directly within directory_root
   Default value is "all". */
//  "directory_root_policy" : "all",

  "webui" :
  {
    "listen" : "0.0.0.0:8888" // remove field to disable WebUI

/* preset credentials. Use password or password_hash */
//  ,"login" : "admin"
//  ,"password" : "password"
//  ,"password_hash" : "some_hash" // password hash in crypt(3) format
//  ,"allow_empty_password" : false // Defaults to true
/* ssl configuration */
//  ,"force_https" : true // disable http
//  ,"ssl_certificate" : "/path/to/cert.pem"
//  ,"ssl_private_key" : "/path/to/private.key"

/* dir_whitelist defines which directories can be shown to user or have folders added (linux only)
   relative paths are relative to directory_root setting */
//  ,"dir_whitelist" : [ "/home/user/MySharedFolders/personal", "work" ]
  }

/* !!! if you set shared folders in config file WebUI will be DISABLED !!!
   shared directories specified in config file  override the folders previously added from WebUI. */
/*,
  "shared_folders" :
  [
    {
      "secret" : "MY_SECRET_1", // required field - use --generate-secret in command line to create new secret
      "dir" : "/home/user/resilio/sync_test", // * required field
      "use_relay_server" : true, //  use relay server when direct connection fails
      "use_tracker" : true,
      "search_lan" : true,
      "use_sync_trash" : true, // enable SyncArchive to store files deleted on remote devices
      "overwrite_changes" : false, // restore modified files to original version, ONLY for Read-Only folders
      "selective_sync" : false, // add folder in selective sync mode
      "known_hosts" : // specify hosts to attempt connection without additional search
      [
        "192.168.1.2:44444"
      ]
    }
  ]
*/

/* Advanced preferences can be added to config file. Info is available at "http://help.getsync.com/customer/portal/articles/1902048-sync-advanced-preferences--more-options"
For example see folder_rescan_interval below */
//, "folder_rescan_interval" : "86400"

}

 

So basically i need to fix this to run Resilio Sync and also  I need to put rslsync as a service and made it start in the startup process.
 

 

Thanks

Share this post


Link to post
Share on other sites

First the OS its Ubuntu 14.04.5 LTS not 16 my error.

Another think I figure out, the PID is never changing in the pid file.
Just in case im doing rslsync --config <<file>> for do the changes.

Edited by Reco-X

Share this post


Link to post
Share on other sites

Another thing.

When i write this command:
ps aux | grep sync

root     21145  0.0  0.0  12224   924 pts/4    S+   17:02   0:00 grep --color=auto sync

But when i try to kill this process throw:

-bash: kill: (21145) - No such process

 

Any suggestions ?

Share this post


Link to post
Share on other sites

And when i try
ps aux | grep sync after reboot the computer i have this


rslsync   4075  0.1  0.0 736764  3468 ?        Ssl  Jun01   0:55 /usr/bin/rslsync --config /etc/resilio-sync/config.json
root     24424  0.0  0.0  12224   928 pts/0    D+   02:04   0:00 grep --color=auto sync

 

The strange here its that the config file its another than and another folder from my configuration

"storage_path" : "/root/rslsync-config",

 

Share this post


Link to post
Share on other sites

Now I will try to delete all the PPAs and only left the original for resilio.

I have this ones
ls
btsync.list
btsync.list.distUpgrade
deluge-team-ppa-trusty.list
deluge-team-ppa-trusty.list.distUpgrade
deluge-team-ppa-trusty.list.save
resilio-sync.list
resilio-sync.list.distUpgrade
tuxpoldo-btsync-trusty.list
tuxpoldo-btsync-trusty.list.distUpgrade

 

Im trying with strange stuff because i dont know the source of the problem.

Share this post


Link to post
Share on other sites

More information about the problem:

after do all this stuff

when i run the program with
rslsync

i have this
root     28146  0.3  0.0 667188  3596 ?        Ssl  04:06   0:00 rslsync
root     28326  0.0  0.0  12220   924 pts/1    S+   04:06   0:00 grep --color=auto rslsync

when i run the program as a service
service resilio-sync start

it takes the configuration from a different file from my configuration file
rslsync    681  0.3  0.0 667160  3628 ?        Ssl  04:11   0:00 /usr/bin/rslsync --config /etc/resilio-sync/config.json
root       698  0.0  0.0  12220   928 pts/1    S+   04:11   0:00 grep --color=auto rslsync

and when i run the program in config mode, it works
rslsync --config sync.conf


root      1535  1.8  0.1 804340  5996 ?        Ssl  04:13   0:00 rslsync --config sync.conf
root      1550  0.0  0.0  12220   928 pts/1    R+   04:13   0:00 grep --color=auto rslsync

 

 

I try to put my config in /etc/resilio-sync/config.json to try the program when it starts as a service, but it doesnt work.
The same when i try to run the program as
rslsync --config /etc/resilio-sync/config.json

Edited by Reco-X

Share this post


Link to post
Share on other sites
Quote

Dear Lucas,

Ubuntu 14.04 has v-init startup system, therefore you need to start and stop Sync using


service resilio-sync start / stop

commands. The binary will pick up the configuration file from /etc/resilio-sync/config.json location - this is how our service works. You can modify the file if you need. Note, that by default Sync is only listening a loopback interface, so if you want to make it listening ALL your interfaces, change the "127.0.0.1" to "0.0.0.0" in config file.

Also note, that Sync is using /var/lib/resilio-sync folder to keep its service data. This folder MUST belong to rslsync user as well as it's full content. Reading thru your forum post indicates that this could be an issue as you started sync under root at least once. Please verify this folder permissions.

Once you are done, there are 2 steps to verify that Sync is working properly:
1. ps aux | grep sync must show you sync a) running b) running under rslsync account, like that:
rslsync  2806  0.0  0.6 525996 12808 ?        Ssl  09:08  0:00 /usr/bin/rslsync --config /etc/resilio-sync/config.json

2.  sudo netstat -anp | grep sync
should show you that sync is listening to at least one NIC for port 8888. On sample below, it listens loopback interface:


tcp        0      0 127.0.0.1:8888          0.0.0.0:*               LISTEN      2806/rslsync    
tcp        0      0 0.0.0.0:62686           0.0.0.0:*               LISTEN      2806/rslsync    
tcp6       0      0 :::62686                :::*                    LISTEN      2806/rslsync    
udp        0      0 127.0.0.1:3838          0.0.0.0:*                           2806/rslsync    
udp        0      0 10.0.2.15:3838          0.0.0.0:*                           2806/rslsync    
udp        0      0 0.0.0.0:3838            0.0.0.0:*                           2806/rslsync    
udp        0      0 0.0.0.0:1900            0.0.0.0:*                           2806/rslsync    
udp        0      0 127.0.0.1:60585         0.0.0.0:*                           2806/rslsync    
udp        0      0 0.0.0.0:62686           0.0.0.0:*                           2806/rslsync    
udp        0      0 10.0.2.15:58889         0.0.0.0:*                           2806/rslsync    
udp6       0      0 :::62686                :::*                                2806/rslsync 

Let me know if something is unclear and you need further guidance.

Roman Zanin,
Resilio Support Team

I have a couple of doubts.

1- If I choose a different path for the configuration file, why the service its still using the default path ?? Its not a big problem I will change it but I think if i can change the path must use my path.
 "storage_path" : "/root/rslsync-config",

2- Why I must create an rslsync user? I want to use the service as root, I know for security reasons every app must be isolated under a user with restricted access, but lets say i dont care for now that, what the problem with the application? And if I want to create the account for rslsync what are the steps ??

a) Create user with the command adduser
b) Give permission of 777 to the folders I sync with the applications  and also the folder that have the program /var/lib/resilio-sync
c) what else?

 

Share this post


Link to post
Share on other sites

Lucas,

This is how our package works. Once you install package, it registers an rslsync user and runs Sync under this user account. If you want to run Sync under different user account, this can be done in 2 ways:

1. Upgrade your Ubuntu to 16.xx. It already has systemd and systemd allows to run services under current user account (which could be root).
2. Don't use a package. Just place a binary to whatever location you like, put config file to any location you like and launch

./rslsync --config <path_to_config>

 

Share this post


Link to post
Share on other sites

Well I did all the stuff that you told me in your reply but it doesnt work properly

First I did:
sudo chown rslsync: /var/lib/resilio-sync
sudo chmod u+w /var/lib/resilio-sync

 

ps aux | grep sync

rslsync   7184  1.0  0.1 739016  4280 ?        Ssl  06:37   0:00 /usr/bin/rslsync --config /etc/resilio-sync/config.json
root      7199  0.0  0.0  12224   928 pts/1    S+   06:37   0:00 grep --color=auto sync


sudo netstat -anp | grep sync

tcp        0      0 127.0.0.1:8888          0.0.0.0:*               LISTEN      7184/rslsync    
tcp        0      0 0.0.0.0:36004           0.0.0.0:*               LISTEN      7184/rslsync    
tcp6       0      0 :::36004                :::*                    LISTEN      7184/rslsync    
udp        0      0 127.0.0.1:55024         0.0.0.0:*                           7184/rslsync    
udp        0      0 127.0.0.1:3838          0.0.0.0:*                           7184/rslsync    
udp        0      0 0.0.0.0:3838            0.0.0.0:*                           7184/rslsync    
udp        0      0 0.0.0.0:1900            0.0.0.0:*                           7184/rslsync    
udp        0      0 37.187.125.87:59493     0.0.0.0:*                           7184/rslsync    
udp        0      0 0.0.0.0:36004           0.0.0.0:*                           7184/rslsync    
udp6       0      0 :::36004                :::*                                7184/rslsync    
unix  3      [ ]         STREAM     CONNECTED     19039875 7184/rslsync        P19039876
unix  3      [ ]         STREAM     CONNECTED     19039876 7184/rslsync        P19039875

 

But it doesnt work, any suggestion please??

 

 

Share this post


Link to post
Share on other sites

@Reco-X From your output I see that process is running and it listens to loopback interface for incoming connections. Could you please elaborate what do you mean under "but it doesnt work properly"? Do you attempt to connect to webUI from a different computer?

Share this post


Link to post
Share on other sites
16 hours ago, RomanZ said:

@Reco-X From your output I see that process is running and it listens to loopback interface for incoming connections. Could you please elaborate what do you mean under "but it doesnt work properly"? Do you attempt to connect to webUI from a different computer?

 

 

Yes that's my goal, so now I understand that the configuration file was wrong.

Now I have another question when I run the service the  old folders that were sync are not more anymore in synchronization, there is any way to move the old config running with the service?

Share this post


Link to post
Share on other sites

@Reco-X Yes. You need to grab your old storage folder and move it to a new location which belongs to service. Also ensure that user running service has full permissions to moved files. Though note, that it'll only work if both storages are located on a single logical drive.

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.