Skip to content

Instantly share code, notes, and snippets.

@ottonet
Forked from wethinkagile/syncthing.conf
Created January 14, 2016 15:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ottonet/b55b0b91ad43d4b63efd to your computer and use it in GitHub Desktop.
Save ottonet/b55b0b91ad43d4b63efd to your computer and use it in GitHub Desktop.
.config/upstart/syncthing.conf
#
# Upstart Configuration File for Ubuntu 14.10 - to run syncthing
#
# Created 27 Dec 2014 - initial file written based on version from
# Syncthing forums here:
# https://forum.syncthing.net/t/keeping-syncthing-running-ubuntu-upstart/30
#
#
# 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:
# https://forum.syncthing.net/t/debugging-syncthing/222
#
# 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="/home/simon/apps/linux/bin/syncthing"
env SYNCTHING_CONF="/home/simon/.config/syncthing"
#----------------------------------------------------------------------#
# set the name of the application
description "Syncthing"
# when Upstart should start syncthing - so when you login to your desktop
start on desktop-start
# when Upstart should stop syncthing - so when you logout to your desktop
stop on desktop-end
# If Upstart detects syncthing has failed - it should restart it
respawn
# the syncthing command Upstart is to execute when it is started up
exec $SYNCTHING_EXE -no-browser -home="$SYNCTHING_CONF"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment