Keeping Syncthing Running: Mac OS X (LaunchDaemon)

I tweeted @saratovsource, and he said the Homebrew version looks for configuration in ~/.config/syncthing. I’m not sure where the downloaded version stores configuration, but I’m testing what happens when I simply install with Homebrew.

@wizonesolutions sorry. I`m look up in the linux host… look at this https://github.com/syncthing/syncthing/blob/master/cmd/syncthing/main.go#L261 Check ~/.syncthing path too…

@wizonesolutions You should find config.xml file in this directory. Please reply if you get some problems… But i think, it should be ok… What old version of Syncthing you have?

@saratovsource 0.9.9. I figured it out, will make separate reply explaining what I did. I got it working :smile:

I was able to get this working in Homebrew by doing the following. I’m not actually sure if I had to do this, but it didn’t cause any problems. Perhaps @saratovsource can correct me if relevant.

As simple as:

pkill syncthing # kill the manually-run daemon from before if relevant

cp -R ~/Library/Application\ Support/Syncthing/ ~/.config/syncthing

rm /usr/local/bin/syncthing # remove symlink if you made one before

brew install syncthing

(and then follow the brew instructions to run it at startup and launch the service)

@wizonesolutions I will try at next week with ~/Library/Application\ Support/Syncthing/ directory… Maybe it will work without copy configs ))))

Is it possible to pass the -no-browser option using this method? Syncthing is generously/annoyingly opening a new web GUI tab every time I wake from sleep. It’s comforting to know the utility is still running, but it’s driving me to madness.

You can just uncheck “Start browser” among the preferences.

duh. Thanks very much

To keep from ruining the performance of other programs, it is wise to add another item to the plist:

<key>ProcessType</key>
<string>Background</string>

I’ve made a pull request for this to homebrew:

Hello. Thanks for this. For a Menu Bar Item I have put up some instructions on github, syncthing/syncthing/issues/982

This used to work, but for some reason it doesn’t autostart anymore. Is this a known error in Yosemite or am I doing something wrong?

This is in the repo, and should work fine (it does for me):

https://github.com/syncthing/syncthing/tree/master/etc/macosx-launchd

How do I kill syncthing? It respawns automatically when I do a regular kill. Do I have to send it a special signal or kill -9? I’m guessing it’s coming back up because of the restart functionality.

There are two processes, you have to kill the monitor process first, and then the app process.

launchctl unload ~/Library/LaunchAgents/syncthing.plist

(or whatever the plist name was)

(launchd respawns syncthing when it’s killed)

@calmh: Yeah, I unloaded it, but even that didn’t make it stop. That’s what was so confusing. I’m pretty sure I am only running it using Homebrew.

OK, yeah, uninstalling using Homebrew and removing the symlink in ~/Library/LaunchAgents DOES make it stop. I can’t find any other way, though. My launchctl unload commands are seemingly ignored. Hrm.

Reinstalling syncthing via Homebrew fixed everything. It’s behaving now and listening when I tell it to stop (it’s been CPU/memory-intensive, so I have been wanting to turn it off while doing things that need those resources).