How do I make a service run at startup

Hi guys

Due to Btsync going all closed source & proprietary I’m trying to switch over to Syncthing, I’ve added the ppa and installed it and it works ok, the problem is I need to start it from the terminal , so I created this .desktop file

[Desktop Entry]
Name=syncthing
Terminal=false
Type=Application
Categories=network;FileTransfer;P2P;GTK;
Comment=Secure, unlimited file-syncing.No Cloud required
Exec=/usr/bin/syncthing
Icon=syncthing
StartupNotify=true

and placed it in /usr/share/applications and created an SSB to open the web gui to open it without using the terminal, but want it to run automatically at startup so I copied the .desktop file to /home/graeme/.config/autostart and that also works but the problem is it loads the web gui at startup and I only want the service to start

any help would be much appreciated

Graeme

Do not know anything about Syncthing but come across this. You might be able to adopt the debian init.d script to your needs (assuming you are not on systemd).

According to this:
http://docs.syncthing.net/users/autostart.html

it looks like the Exec= line in your autostart .desktop should read something like

Exec=/usr/bin/syncthing -no-browser -home="/home/emegra/.config/syncthing"

Check if you have a directory at
/home/emegra/.config/syncthing
and adjust the path as necessary.

but it looks like it’s the “-no-browser” option you’re after.

HI SeZo

Thanks for that I had a look at your link but to be honest I’m not really sure what to do there it looks a little involved for me, but as it happens it may not be necessary as I got it working the way I want by editing the Exec line in my ~/.config/autostart/syncthing.desktop file

Many thanks

Graeme

Hi Mark

I tried what you suggested by adding this to the Exec= line

/usr/bin/syncthing -no-browser -home="/home/graeme/.config/syncthing"

you’ll notice I changed emegra to graeme I assume that was a typo ?

that stopped the web ui opening up at boot but syncthing wasn’t running so I changed the line to

Exec=/usr/bin/syncthing -no-browser 

and now it seems to be working fine, syncthing is running at boot and the web ui only opens when I click on the icon

I do have a directory at /home/graeme/.config/syncthing so i don’t know why it didn’t work

many thanks

Graeme

Wasn’t a typo as much as a guess (I hadn’t spotted the home folder path in your first post) :wink:

anyway, if it’s working it’s working…

You’re welcome :slight_smile: