Make btsync start at boot


aaronk

Recommended Posts

I  just completed a clean install of Ubuntu 15.10.   I did all available updates. I installed btsync  by way of the new official apt-get.  I am able to use the commands to start and stop the service.   The problem is I am trying to make it auto start.   There is an init.d  script in place that is very different from what other people are using (see above). This may be a rookie mistake but I can't find any information because of how the new be official apt-get option is.

Link to comment
Share on other sites

aaron@ubuntu:~$ sudo systemctl enable btsync
[sudo] password for aaron: 
Synchronizing state of btsync.service with SysV init with /lib/systemd/systemd-sysv-install...
Executing /lib/systemd/systemd-sysv-install enable btsync
The unit files have no [Install] section. They are not meant to be enabled
using systemctl.
Possible reasons for having this kind of units are:
1) A unit may be statically enabled by being symlinked from another unit's
   .wants/ or .requires/ directory.
2) A unit's purpose may be to act as a helper for some other unit which has
   a requirement dependency on it.
3) A unit may be started when needed via activation (socket, path, timer,
   D-Bus, udev, scripted systemctl call, ...).

Link to comment
Share on other sites

You can create a unit file for btsync (probably should be done automatically by the deb package).

 

Create the file: /etc/systemd/system/btsync.service

Containing:

[Unit]
Description=Bittorent Sync service
After=network.target
 
[Service]
Type=forking
User=btsync
Group=btsync
ExecStart=/usr/bin/btsync
Restart=on-abort

[Install]
WantedBy=multi-user.target

 

Once that file is in place enabling the service should work

sudo systemctl enable btsync

 

Link to comment
Share on other sites

On 28.2.2016 at 3:35 AM, cjsheets said:

You can create a unit file for btsync (probably should be done automatically by the deb package).

 

Create the file: /etc/systemd/system/btsync.service

Containing:


[Unit]
Description=Bittorent Sync service
After=network.target
 
[Service]
Type=forking
User=btsync
Group=btsync
ExecStart=/usr/bin/btsync
Restart=on-abort

[Install]
WantedBy=multi-user.target

 

 

Actually that won't work 100%. You forgot to add the configuration file to the ExecStart command.

It should say this:
 

ExecStart=/usr/bin/btsync --config /etc/btsync/config.json

Otherwise btsync will create a new syncdata folder and not use any of your settings you have configured in your config file.

Link to comment
Share on other sites

@Roman Z that made it work and boot at start.

my next part I am working on is getting permissions fixed. I tried using this command hoping to get the user running the service to change to pi and received this message. 

pi@raspberrypi:~ $ sudo systemctl --user start btsync
Failed to get D-Bus connection: Connection refused
 

Edited by aaronk
Link to comment
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.