g2nightmare Posted September 26, 2013 Report Share Posted September 26, 2013 Has anybody gotten this to work on Fedora 18/19? I ended up using a script very similar to this: https://gist.github.com/ricco386/5467477 And added it to chkconfig using this: http://unix.stackexchange.com/questions/20357/how-can-i-make-a-script-in-etc-init-d-start-at-boot At startup, it appears to work. The problem is that 50% of the time, sync never gets forced, so I need to find a way to restart the service. Doing: service btsync stop says that it occurs, but upon checking "top," the process still runs and the service is never killed. It seems to me that killproc never actually reads the pid file (yes I pointed it to the right directory) and never actually kills anything. Does anybody have a working script? Quote Link to comment Share on other sites More sharing options...
jcollie Posted September 27, 2013 Report Share Posted September 27, 2013 You're much better off creating a native systemd unit file. Put the following into a file called /etc/systemd/system/btsync@.service[Unit]Description=BitTorrent Sync for %i[Service]Type=simpleUser=%iExecStart=/usr/local/bin/btsync --nodaemon --config %h/.sync/sync.confWorkingDirectory=%h[Install]WantedBy=multi-user.targetCopy the btsync binary to /usr/local/bin.$ mkdir ~/.sync$ btsync --dump-sample-config > ~/.sync/sync.confEdit ~/.sync/sync.conf and change the storage_path config entry so that it's pointing to the right directory. You can then start up btsync by running the following command as root:# systemctl start btsync@username.serviceIf you want btsync to start up at boot run the following command as root:# systemctl enable btsync@username.serviceOther useful commands:# systemctl status btsync@username.service btsync@username.service - BitTorrent Sync for username Loaded: loaded (/etc/systemd/system/btsync@.service; disabled) Active: active (running) since Fri 2013-09-27 11:23:38 CDT; 1min 15s ago Main PID: 23277 (btsync) CGroup: /system.slice/system-btsync.slice/btsync@username.service └─23277 /usr/local/bin/btsync --nodaemon --config /home/username/.sync/sync.confSep 27 11:23:38 localhost systemd[1]: Starting BitTorrent Sync for username...Sep 27 11:23:38 localhost systemd[1]: Started BitTorrent Sync for username.And to restart btsync:# systemctl restart btsync@username.serviceIf multiple users want to run BitTorrent Sync on the same system they'll need to make sure that the web UI listens on a unique port. Quote Link to comment Share on other sites More sharing options...
jcollie Posted September 27, 2013 Report Share Posted September 27, 2013 I've put some files out on GitHub that will let you create a btsync rpm package that will make all of this very easy: https://github.com/jcollie/btsync Quote Link to comment Share on other sites More sharing options...
g2nightmare Posted October 9, 2013 Author Report Share Posted October 9, 2013 Sorry I took so long to get back to this. I'll have to try what you suggested tomorrow and thanks for all of your work. I'm excited to get this to work. I had been using an alias in my bashrc to solve the problem. Quote Link to comment Share on other sites More sharing options...
ftrotter Posted November 25, 2013 Report Share Posted November 25, 2013 Jcollie, Your instructions seem geared towards having the sync start "for this user" when this user logs in... is that right? If that is how your scripts are intended to be used, thats great... but that is not an appropriate configuration for a backup server which should have the bittorrent sync service start upon a hard reboot, even if a given user does not login. I find the new "non-init.d" services on Fedora pretty confusing... and I do not understand why this problem has not been solved by the bittorrent sync developers... since it seems pretty fundemental to adoption to have reliable rpm/deb files... (*sigh*) -FT Quote Link to comment Share on other sites More sharing options...
nocturnal Posted January 16, 2014 Report Share Posted January 16, 2014 (edited) Jcollie, Your instructions seem geared towards having the sync start "for this user" when this user logs in... is that right? If that is how your scripts are intended to be used, thats great... but that is not an appropriate configuration for a backup server which should have the bittorrent sync service start upon a hard reboot, even if a given user does not login. I find the new "non-init.d" services on Fedora pretty confusing... and I do not understand why this problem has not been solved by the bittorrent sync developers... since it seems pretty fundemental to adoption to have reliable rpm/deb files... (*sigh*) -FT No. It does not mean that the user has to log in, systemd will start the btsync service as that user on boot. HIs setup here enables the flexibility for multiple users to have btsync running a a service controlled by systemd on boot, as long as they enabled it It does not have to be done this way, you can "hard code" it to one user if so desired. example: [unit]Description=BitTorrent Sync [service]Type=simpleUser=userExecStart=/usr/bin/btsync --nodaemon --config /home/user/.config/btsync/btsync.conf [install]WantedBy=multi-user.target then systemctl enable btsync kp Edited January 16, 2014 by nocturnal Quote Link to comment Share on other sites More sharing options...
Thor828 Posted February 16, 2014 Report Share Posted February 16, 2014 jcollie Tried your method and got the following error. Any ideas? [thor@localhost .sync]$ sudo systemctl start btsync@Thor.service[thor@localhost .sync]$ sudo systemctl status -l btsync@Thor.servicebtsync@Thor.service - BitTorrent Sync for Thor Loaded: loaded (/etc/systemd/system/btsync@Thor.service; disabled) Active: failed (Result: exit-code) since Sun 2014-02-16 15:49:40 EST; 5s ago Process: 8028 ExecStart=/usr/local/bin/btsync --nodaemon --config home/Thor/.sync/sync.conf (code=exited, status=217/USER) Main PID: 8028 (code=exited, status=217/USER) Feb 16 15:49:40 localhost.localdomain systemd[1]: Started BitTorrent Sync for Thor.Feb 16 15:49:40 localhost.localdomain systemd[1]: btsync@Thor.service: main process exited, code=exited, status=217/USERFeb 16 15:49:40 localhost.localdomain systemd[1]: Unit btsync@Thor.service entered failed state. Quote Link to comment Share on other sites More sharing options...
laics1984 Posted April 17, 2014 Report Share Posted April 17, 2014 Hi jcollie, I have exactly the same error as Thor828. May I know how can I fix this? Error: Active: failed (Result: exit-code) since Sun 2014-02-16 15:49:40 EST; 5s ago When I run sudo systemctl status -l btsync@Thor.service Thanks, Quote Link to comment Share on other sites More sharing options...
mpicher Posted December 31, 2014 Report Share Posted December 31, 2014 Having trouble making this start also with version 1.4 When I run 'journalctl -xe' I am seeing ...'failed to run 'start' task: Operation not supported' Thanks Quote Link to comment Share on other sites More sharing options...
sciurius Posted January 1, 2015 Report Share Posted January 1, 2015 Tried your method and got the following error. Any ideas? [thor@localhost .sync]$ sudo systemctl start btsync@Thor.service Is your user name Thor (with capital T)? The log reads --config home/Thor/... This is missing a leading slash. Is your home /home/Thor (capital T)? Quote Link to comment Share on other sites More sharing options...
vigilian Posted March 15, 2016 Report Share Posted March 15, 2016 can't we dump the existing config file? I have already a configuration, binary I presume, since I'm launching btsync manually for a long time now. Can't we use it ? And what about a screen before launching btsync? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.