{"action":"opened","issue":{"url":"https://api.github.com/repos/syncthing/syncthing/issues/1390","labels_url":"https://api.github.com/repos/syncthing/syncthing/issues/1390/labels{/name}","comments_url":"https://api.github.com/repos/syncthing/syncthing/issues/1390/comments","events_url":"https://api.github.com/repos/syncthing/syncthing/issues/1390/events","html_url":"https://github.com/syncthing/syncthing/issues/1390","id":59408554,"number":1390,"title":"Syncthing upgrade restarts monitor process","user":{"login":"canton7","id":568104,"avatar_url":"https://avatars.githubusercontent.com/u/568104?v=3","gravatar_id":"","url":"https://api.github.com/users/canton7","html_url":"https://github.com/canton7","followers_url":"https://api.github.com/users/canton7/followers","following_url":"https://api.github.com/users/canton7/following{/other_user}","gists_url":"https://api.github.com/users/canton7/gists{/gist_id}","starred_url":"https://api.github.com/users/canton7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/canton7/subscriptions","organizations_url":"https://api.github.com/users/canton7/orgs","repos_url":"https://api.github.com/users/canton7/repos","events_url":"https://api.github.com/users/canton7/events{/privacy}","received_events_url":"https://api.github.com/users/canton7/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-03-01T17:39:56Z","updated_at":"2015-03-01T17:39:56Z","closed_at":null,"body":"This relates to #682.\r\n\r\nI'm writing a windows utility which hosts syncthing.exe (and act as a REST client). It's therefore responsible for starting and stopping syncthing.exe, and keeps track of whether syncthing.exe is running.\r\n\r\nIn general all's well and good, apart from when Syncthing upgrades itself. In this event, the monitor process restarts. However this means that my utility sees it exit with a 'success' exit code, and any attempts to start a new process are thwarted by the fact that the now-restarted syncthing.exe has locked the database. Essentially syncthing.exe escapes the process tree it was previously in, and re-established itself outside of the context of my utility.\r\n\r\nAn ideal solution for me would be a command-line flag which stops Syncthing from automatically restarting. An event could then indicate that an automatic upgrade was complete, and I could manually restart it.\r\n\r\nA less ideal solution would be a non-zero exit code when the monitor process restarts, so I can at least inform the user that they should kill all running syncthing.exe processes before attempting to use my utility again.\r\n\r\nThanks\r\n\r\n"}}