Keeping Syncthing Running: Mac OS X (LaunchDaemon)

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).

Is there a special reason for naming se.nym.syncthing.plist instead of syncthing.plist ?

The plist files are often named with reverse domain to ensure uniqueness. I probably named it like that at some point before syncthing.net was registered.

Just a small suggestion - in the readme, put the example launchctl command on itā€™s own line. Much like others above, I was a little confused by having the command split across two lines to suit the English paragraph :smile:

Even though this seems to be a really thread, it still worked for me on my Macā€¦at first. Now it doesnā€™t load on restart, but the launchctl command says it is already loaded. Thanks!!

2 Likes

thank you.

I am also having a problem getting syncthing to actually start automatically. I followed instructions here: https://docs.syncthing.net/users/autostart.html#mac-os-x

launchctl says it is running:

launchctl list | grep syncthing
-	0	homebrew.mxcl.syncthing

However there is no PID, other devices cant see it and there is no web GUI or logs, so I doubt that it is actually running. Iā€™ve tried using start / stop / load / unload / kickstart / sudo and messing with permissions and no luck. Running syncthing as a foreground app works fine BTW.

Any debugging suggestions?