# Problem running syncthing as a service

**URL:** https://forum.syncthing.net/t/problem-running-syncthing-as-a-service/7188
**Category:** Support
**Created:** [April 18, 2016, 6:52pm UTC](https://forum.syncthing.net/t/problem-running-syncthing-as-a-service/7188 "2016-04-18T18:52:27Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![kankamuso](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/k/8e8cbc/32.png) [@kankamuso](https://forum.syncthing.net/u/kankamuso)
#### Post date: [April 18, 2016, 6:52pm UTC](https://forum.syncthing.net/t/problem-running-syncthing-as-a-service/7188/1 "2016-04-18T18:52:27Z")

</div>

Hi,

I am running syncthing in both a server (W2012 R2) and a desktop machine (W10). 2012 machine is running fine but the desktop is causing some headaches. I have configured the syncthing executable to be run as a scheduled task triggered when system starts. It seems to be doing fine but syncthing dies when the computer enters the suspend status and is not recovered when going back to life. Have you ever experienced something similar?. (I have tried adding new triggers like power configuration and when internet conection is up but none seem to trigger it)

Another question coming from the same problem… Trying to solve those problems, I tried to configure syncthing as a service with nssm. It seems to be running fine but all configuration (repositories, remote machines IDs, etc…) are lost. Going back to scheduled task start up recovers the configuration… Why is this happening?. Why does not nssm read configuration correctly?.

Thanks in advance,

Jose

---

<div class="post-metadata">

### Author: ![calmh](https://forum.syncthing.net/user_avatar/forum.syncthing.net/calmh/32/15311_2.png) [@calmh](https://forum.syncthing.net/u/calmh)
#### Post date: [April 18, 2016, 7:20pm UTC](https://forum.syncthing.net/t/problem-running-syncthing-as-a-service/7188/2 "2016-04-18T19:20:36Z")

</div>

> [@kankamuso](#):
>
> syncthing dies when the computer enters the suspend status

Try going into the “Advanced” options and turning off `restartOnWakeup` which is somewhere in there.

> [@kankamuso](#):
>
> Why does not nssm read configuration correctly?.

Best guess is that it runs as a different user to your normal account.

---

<div class="post-metadata">

### Author: ![kankamuso](https://forum.syncthing.net/letter_avatar_proxy/v4/letter/k/8e8cbc/32.png) [@kankamuso](https://forum.syncthing.net/u/kankamuso)
#### Post date: [April 19, 2016, 7:39pm UTC](https://forum.syncthing.net/t/problem-running-syncthing-as-a-service/7188/3 "2016-04-19T19:39:27Z")

</div>

Thannks for your response. I have been reading about the purpose of this parameter but I cannot make an idea on how this could help me. I mean, why could this be happening? (syncthing not starting upon wake up).

For the second question, I have tried running both as the system user and as the local user I am using to start the scheduled task… Still guessing what the problem is.

Thanks again,

Jose

---

<div class="post-metadata">

### Author: ![AudriusButkevicius](https://forum.syncthing.net/user_avatar/forum.syncthing.net/audriusbutkevicius/32/277_2.png) [@AudriusButkevicius](https://forum.syncthing.net/u/AudriusButkevicius)
#### Post date: [April 19, 2016, 7:45pm UTC](https://forum.syncthing.net/t/problem-running-syncthing-as-a-service/7188/4 "2016-04-19T19:45:08Z")

</div>

So syncthing will restart upon detecting that the system has been sleeping. If you run syncthing normally, it has two processes, the monitor process and the actual syncthing process. As syncthing restarts, the monitor process detects that and restarts it. If you run via syncthing via some service manager or some other magic which is supposed to replace the monitor process, it’s probably not doing it’s job and not restarting syncthing properly.

---

<div class="post-metadata">

### Author: ![system](https://forum-uploads.syncthingcdn.net/original/2X/0/0b50e0a202b22ae6a67190759e8c868805b8ed9f.png) [@system](https://forum.syncthing.net/u/system)
#### Post date: [May 19, 2016, 7:45pm UTC](https://forum.syncthing.net/t/problem-running-syncthing-as-a-service/7188/5 "2016-05-19T19:45:14Z")

</div>

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