X-Git-Url: http://git.iain.cx/?a=blobdiff_plain;f=service.h;h=b35edcca2c2f5a2344539bcf889f556b473b8170;hb=e26682667e15433cad518e622c3c061840b487dd;hp=dd96f7cab5a10762a265b0e5548f4c3c3460dd9a;hpb=b5286398f850b432edbddc6d602ab3f33ab086be;p=nssm.git diff --git a/service.h b/service.h index dd96f7c..b35edcc 100644 --- a/service.h +++ b/service.h @@ -72,11 +72,14 @@ typedef struct { HANDLE stderr_thread; unsigned long stderr_tid; bool rotate_files; + bool stdout_copy_and_truncate; + bool stderr_copy_and_truncate; unsigned long rotate_stdout_online; unsigned long rotate_stderr_online; unsigned long rotate_seconds; unsigned long rotate_bytes_low; unsigned long rotate_bytes_high; + unsigned long rotate_delay; unsigned long default_exit_action; unsigned long restart_delay; unsigned long throttle_delay; @@ -91,17 +94,25 @@ typedef struct { HANDLE process_handle; unsigned long pid; HANDLE wait_handle; + unsigned long exitcode; bool stopping; bool allow_restart; unsigned long throttle; CRITICAL_SECTION throttle_section; bool throttle_section_initialised; + CRITICAL_SECTION hook_section; + bool hook_section_initialised; CONDITION_VARIABLE throttle_condition; HANDLE throttle_timer; LARGE_INTEGER throttle_duetime; + FILETIME nssm_creation_time; FILETIME creation_time; FILETIME exit_time; TCHAR *initial_env; + unsigned long last_control; + unsigned long start_requested_count; + unsigned long start_count; + unsigned long exit_count; } nssm_service_t; void WINAPI service_main(unsigned long, TCHAR **); @@ -129,6 +140,8 @@ int set_service_description(const TCHAR *, SC_HANDLE, TCHAR *); int get_service_description(const TCHAR *, SC_HANDLE, unsigned long, TCHAR *); int get_service_startup(const TCHAR *, SC_HANDLE, const QUERY_SERVICE_CONFIG *, unsigned long *); int get_service_username(const TCHAR *, const QUERY_SERVICE_CONFIG *, TCHAR **, size_t *); +void set_service_environment(nssm_service_t *); +void unset_service_environment(nssm_service_t *); int pre_install_service(int, TCHAR **); int pre_remove_service(int, TCHAR **); int pre_edit_service(int, TCHAR **); @@ -142,6 +155,6 @@ int start_service(nssm_service_t *); int stop_service(nssm_service_t *, unsigned long, bool, bool); void CALLBACK end_service(void *, unsigned char); void throttle_restart(nssm_service_t *); -int await_shutdown(nssm_service_t *, TCHAR *, unsigned long); +int await_single_handle(SERVICE_STATUS_HANDLE, SERVICE_STATUS *, HANDLE, TCHAR *, TCHAR *, unsigned long); #endif