I’m on OSX and I have Syncthing autostarting using the plist method as described in the docs.
Sometimes I get sync errors and I want to just quickly look to see what files are causing the problems. So far I have been getting the debug logs by adding some commands to the plist (as suggested in the below link). The downfall is that I reboot the system to see the logs.
If your LaunchAgent plist, you could add (for example) this to log to say /tmp/
Now, I use Homebrew too (awesome) but for something like SyncThing, it really doesn’t make much sense to use it in my opinion. Homebrew is great for things with lots of dependencies/options, say php, but SyncThing being a single binary it seems overkill. …
Can someone provide a step by step method on getting the logs to show up in Terminal? I’m a bit of a newbie, so please have patience
I see in the above thread that Syncthing can be started from Terminal to show the logs, but I couldnt get it to work.
I found a solution to debug. I just started the application over the command prompt and the error message was shown in the terminal. It was a permission error. Now, everything is working fine
This is what I tried.
cd to folder with syncthing
in terminal typed: syncthing -verbose
I get this in terminal ‘-bash: syncthing: command not found’
What am I doing wrong?
./syncthing in the directory the binary is.
Now the only problem I get is this
FATAL: Cannot open database: resource temporarily unavailable - Is another copy of Syncthing already running?
I’ve tried to shutdown via the GUI and I get a ‘Shutdown is complete’ message but the FATAL error is still there. Any suggestions?
Well your shut down didnt work it seems, terminate it through the process manager and try again.
Nope. Cant kill the process either. It just keeps restarting after every forced quit
So it’s the service daemon probably restarting it after you kill it.
You should do:
sudo launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.syncthing.plist
then try killing it.
Sorry, I should have specified. I used the non-Homebrew method.
So I just copied the .plist that came in the etc folder in the included binaries.
I changed the user to my info and then copied that to launchdAgents folder.
I did try to use the:
sudo launchctl unload /Library/LaunchAgents/se.nym.syncthing.plist
But I get this:
launchctl: Error unloading: se.nym.syncthing
sudo chown root <filename>
sudo chmod 644 <filename>
To be able to run the launchctl commands.
This is what my plist looks like (minus the header):
Well the procedure for unloading the plist is the same, it’s just the path that is different.
Yes, I did change the path to my plist path.
What I did to make sure the path was correct was I dragged the plist into Terminal.
But for some reason I get the error that it cannot unload. Terminal doesnt give any other explaination.
edit: I had to use the -w flag
sudo launchctl unload -w /Library/LaunchAgents/se.nym.syncthing.plist
But killing the syncthing process in activity monitor still doesnt work. Always restarts. I have also noticed that shutting down via the GUI does nothing.
Well Syncthing is persistent. This is too much trouble. I can just stick with my old change the plist and reboot method.
Thanks for your help Audrius
http://www.soma-zone.com/LaunchControl/ is a fantastic GUI for launchd and lets you easily enable/disable items as well as load/unload.
Thanks so much for the suggestion on LaunchControl
It worked like a charm