Hey,
I am fairly new to syncthing but it is great. However I would need your help with something.
My setup: I have 2 Windows 10 computers on which I have successfully installed syncthing and auto start them using the task scheduler. Both are running the newest release of syncthing and are syncing.
Now I wanted to setup an old laptop as sort of a man in the middle if one or the other Windows 10 computer is not connected and running.
The laptop is running Ubuntu 14.04 LTS server with no GUI and static IP address.
I have followed this tutorial to install syncthing:
Except for the IP tables part. I have opened port 8080 in ufw and have added the other ports via a ufw configuration file for syncthing:
It is located in: /etc/ufw/applications.d
With this content:
[Syncthing]
title=Syncthing
description=Open Source Continuous File Synchronization
ports=22000/tcp|21027/udp
Afterwards I added it with sudo ufw allow syncthing and rules were successfully written.
My upstart file /home/ben/.config/upstart/syncthing.conf looks like this: it is a modified version of the one included in the tutorial. I changed the folder locations and the upstart events. Due to only being able to post one link I removed the links in the script but you can see the original version in the referenced tutorial.
_> Upstart Configuration File for Ubuntu 14.10 - to run syncthing
_> #
_> # Created 27 Dec 2014 - initial file written based on version from
_> # Syncthing forums here:
_> # link removed please see referenced tutorial for original
_> #
_> #
_> # BEFORE USE: change:
_> #
_> # 1) the 'env SYNCTHING_EXE=' line below so it has the correct path
_> # to wherever you have installed the syncthing executable on your
_> # computer - maybe '$HOME/bin'?
_> # Enter the full path, as the use of $HOME wont work (I believe?)
_> # as Upstart does not inherit your normal environment variables.
_> #
_> # 2) the 'env SYNCTHING_CONF=' so the path shown to the 'syncthing'
_> # configuration files is right. The default location is:
_> # $HOME/.config/syncthing
_> # In the line below, the text "/home/simon/.config/syncthing" needs
_> # to match your own home directory location. So on Ubuntu - the
_> # directory path needs to be changed, replacing the word 'simon'
_> # with your own username. The use of $HOME wont work (I believe?)
_> # as Upstart does not inherit your normal environment variables.
_> #
_> # INSTALLATION:
_> # To install and use - copy (or symlink) this file (once updated) to
_> # this path on you computer:
_> #
_> # $HOME/.config/upstart/syncthing.conf
_> #
_> # If you want to find that folder in the graphical Ubuntu 'Files'
_> # application (ie Nautilus), you will need to first press the keys
_> # 'Ctrl+h' on you keyboard to see hidden items.
_> # The '.config' folder should then be visible, and enable you to
_> # navigate into it. Press the keys 'Ctrl+h' on you keyboard to re-hide
_> # the hidden items when done. Other wise just copy the file in a Terminal
_> # window with the 'cp' command
_> #
_> # NB: You will need to login out of your desktop and back in to start
_> # syncthing running!
_> #
_> # LOGGING INFO:
_> # Any output will be logged to: $HOME/.cache/upstart/syncthing.log
_> # (or syncthing.log.1.gz) To view the last 50 log entries in the file
_> # from a terminal window use the command:
_> #
_> # tail -50 $HOME/.cache/upstart/syncthing.log
_> #
_> # or if the system has gziped the log file, you can use the equivalent
_> # command:
_> #
_> # zcat $HOME/.cache/upstart/syncthing.log.1.gz | tail -50
_> #
_> # NOTES:
_> # syncthing startup options used:
_> #
_> # -no-browser : stops a browser window being opened if syncthing starts
_> # up or restarts
_> # -home="$SYNCTHING_CONF" : default syncthing configuration files location
_> #
_> # You can also add below the following syncthing environment variable options
_> # if required:
_> #
_> # env STNORESTART=yes
_> # : if syncthing crashes or tries to restart, it will just exit
_> # instead
_> # env STTRACE=beacon,net
_> # : will enable debug output for 'beacon' & 'net'. See the Syncthing
_> # forum post here for more info:
_> # link removed please see referenced tutorial for original
_> #
_> # You can run syncthing from a terminal window to see a full list of the
_> # command line options that are available. The command to use is:
_> #
_> # syncthing --help
_> #
_> #
_> # CHANGE BELOW TO MATCH YOUR REQUIREMENTS:
_> #----------------------------------------------------------------------#
_> env SYNCTHING_EXE="/usr/bin/syncthing"
_> env SYNCTHING_CONF="/home/ben/.config/syncthing"
_> env STNORESTART=yes
_> #----------------------------------------------------------------------#
_> # set the name of the application
_> description "Syncthing"
_> # when Upstart should start syncthing - so when you login to your desktop
_> #start on desktop-start
_> start on (local-filesystems and net-device-up IFACE!=lo)
_> # when Upstart should stop syncthing - so when you logout to your desktop
_> #stop on desktop-end
_> stop on runlevel [!2345]
_> setuid "ben"
_> setgid "ben"
_> # the syncthing command Upstart is to execute when it is started up
_> exec $SYNCTHING_EXE -no-browser -home="$SYNCTHING_CONF"
_> # If Upstart detects syncthing has failed - it should restart it
_> respawn
I could start syncthing succesfully via command: syncthing
But it will not autostart after I reboot the server.
There is also no file in /home/ben/autostart
No after messing with it I cannot even get it to run manually anymore :-(.
Can anyone help? I just want syncthing to run on my Ubuntu server as a service and autostart after I reboot the server with sudo reboot command.
Thank you!
Ubuntugeek