Shutdown Syncthing gracefully in windows

Continuing the discussion from Windows Command Line Graceful Startup and Shutdown possible?:

Didn’t work:

taskkill /IM syncthing.exe

Ursache: Die Beendigung dieses Prozesses muss erzwungen werden
(mit der Option /F).
FEHLER: Der Prozess "syncthing.exe" mit PID 3212 konnte nicht beendet werden.
Ursache: Die Beendigung dieses Prozesses muss erzwungen werden
(mit der Option /F).```

The message says:  
- ERROR: The process could not be stopped.
- Reason: You have to force stopping this process (with option /F).

Is there any other simple command line to gracefully stop syncthing on windows?

You’d have to call the rest API.

Thanks.

Yes i read about it in the other thread already.

But it did not immediately work for me due to some slightly different setup:

I use HTTPS only with a self-signed certificate.

Thus i had to use THIS command instead:

curl -v -k -X POST -H X-API-Key:MY-API-KEY https://localhost:8384/rest/system/shutdown

  • Changed http to https
  • Added -k to bypass the serious SSL-checks and just accept the self-signed certificate
  • Added -v for verbose mode, for better debugging (optional)

FUN FACT (bug in the forum?):
It is impossible to post a single-line-code-block which starts with “curl”. But CURL works. Oh and " curl" works too: curl (even looks like no space).

When you try to do so the forum will not save your post without any error message … there is just the “Saving (spinner)”.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.