Beispiel #1
0
/*
  FUNCTION: smpd_service_main

  PURPOSE: To perform actual initialization of the service

  PARAMETERS:
    dwArgc   - number of command line arguments
    lpszArgv - array of command line arguments

  RETURN VALUE:
    none

  COMMENTS:
    This routine performs the service initialization and then calls
    the user defined smpd_entry_point() routine to perform majority
    of the work.
*/
void smpd_service_main(int argc, char *argv[])
{
    SMPD_UNREFERENCED_ARG(argc);
    SMPD_UNREFERENCED_ARG(argv);

    /* register our service control handler: */
    smpd_process.sshStatusHandle = RegisterServiceCtrlHandler( TEXT(SMPD_SERVICE_NAME), smpd_service_ctrl);
    
    if (!smpd_process.sshStatusHandle)
	return;
    
    /* SERVICE_STATUS members that don't change in example */
    smpd_process.ssStatus.dwServiceType = SERVICE_WIN32_OWN_PROCESS;
    smpd_process.ssStatus.dwServiceSpecificExitCode = 0;

    /* report the status to the service control manager. */
    if (!smpd_report_status_to_sc_mgr(SERVICE_START_PENDING, NO_ERROR, 3000))
    {
	smpd_report_status_to_sc_mgr(SERVICE_STOPPED, NO_ERROR, 0);
	return;
    }

    smpd_entry_point();
    smpd_clear_process_registry();

    /* try to report the stopped status to the service control manager. */
    if (smpd_process.sshStatusHandle)
    {
	smpd_report_status_to_sc_mgr(SERVICE_STOPPED, 0, 0);
    }
}
Beispiel #2
0
int smpd_get_smpd_password_from_parent(SMPDU_Sock_set_t set, SMPDU_Sock_t sock)
{
    smpd_enter_fn(FCNAME);
    SMPD_UNREFERENCED_ARG(set);
    SMPD_UNREFERENCED_ARG(sock);
    smpd_exit_fn(FCNAME);
    return SMPD_FAIL;
}
int smpd_get_user_data_default(const char *key, char *value, int value_len)
{
    smpd_enter_fn(FCNAME);
    /* FIXME: function not implemented */
    SMPD_UNREFERENCED_ARG(key);
    SMPD_UNREFERENCED_ARG(value);
    SMPD_UNREFERENCED_ARG(value_len);
    smpd_exit_fn(FCNAME);
    return SMPD_FAIL;
}
Beispiel #4
0
void timeout_thread(void *p)
{
    SMPDU_Size_t num_written;
    char ch = -1;

    SMPD_UNREFERENCED_ARG(p);

    Sleep(smpd_process.timeout * 1000);
    smpd_err_printf("\nmpiexec terminated job due to %d second timeout.\n", smpd_process.timeout);
    if (smpd_process.timeout_sock != SMPDU_SOCK_INVALID_SOCK)
    {
	SMPDU_Sock_write(smpd_process.timeout_sock, &ch, 1, &num_written);
	Sleep(30000); /* give the engine 30 seconds to shutdown and then force an exit */
    }
    ExitProcess((UINT)-1);
}