X-Git-Url: http://git.iain.cx/?a=blobdiff_plain;f=registry.cpp;h=bf2ddc5ed4f916d30a06edf37e752c299de1b5c5;hb=b5286398f850b432edbddc6d602ab3f33ab086be;hp=6c1567ce152bb5806e329456f0ea542703849ced;hpb=d340e13effcabebb9eed2ace2e7874eff683e13d;p=nssm.git diff --git a/registry.cpp b/registry.cpp index 6c1567c..bf2ddc5 100644 --- a/registry.cpp +++ b/registry.cpp @@ -79,6 +79,8 @@ int create_parameters(nssm_service_t *service, bool editing) { else if (editing) RegDeleteValue(key, NSSM_REG_KILL_WINDOW_GRACE_PERIOD); if (service->kill_threads_delay != NSSM_KILL_THREADS_GRACE_PERIOD) set_number(key, NSSM_REG_KILL_THREADS_GRACE_PERIOD, service->kill_threads_delay); else if (editing) RegDeleteValue(key, NSSM_REG_KILL_THREADS_GRACE_PERIOD); + if (! service->kill_process_tree) set_number(key, NSSM_REG_KILL_PROCESS_TREE, 0); + else if (editing) RegDeleteValue(key, NSSM_REG_KILL_PROCESS_TREE); if (service->stdin_path[0] || editing) { if (service->stdin_path[0]) set_expand_string(key, NSSM_REG_STDIN, service->stdin_path); else if (editing) RegDeleteValue(key, NSSM_REG_STDIN); @@ -649,6 +651,14 @@ int get_parameters(nssm_service_t *service, STARTUPINFO *si) { override_milliseconds(service->name, key, NSSM_REG_KILL_WINDOW_GRACE_PERIOD, &service->kill_window_delay, NSSM_KILL_WINDOW_GRACE_PERIOD, NSSM_EVENT_BOGUS_KILL_WINDOW_GRACE_PERIOD); override_milliseconds(service->name, key, NSSM_REG_KILL_THREADS_GRACE_PERIOD, &service->kill_threads_delay, NSSM_KILL_THREADS_GRACE_PERIOD, NSSM_EVENT_BOGUS_KILL_THREADS_GRACE_PERIOD); + /* Try to get process tree settings - may fail. */ + unsigned long kill_process_tree; + if (get_number(key, NSSM_REG_KILL_PROCESS_TREE, &kill_process_tree, false) == 1) { + if (kill_process_tree) service->kill_process_tree = true; + else service->kill_process_tree = false; + } + else service->kill_process_tree = true; + /* Try to get default exit action. */ bool default_action; service->default_exit_action = NSSM_EXIT_RESTART;