Ejemplo n.º 1
0
/**
 * Start all the services
 *
 * @return Return the number of services started
 */
int
serviceStartAll()
{
SERVICE	*ptr;
int	n = 0,i;

	config_enable_feedback_task();

	ptr = allServices;
	while (ptr && !ptr->svc_do_shutdown)
	{
		n += (i = serviceStart(ptr));

		if(i == 0)
		{
			LOGIF(LE, (skygw_log_write(
				LOGFILE_ERROR,
				"Error : Failed to start service '%s'.",
				ptr->name)));
		}

		ptr = ptr->next;
	}
	return n;
}
Ejemplo n.º 2
0
/**
 * Start all the services
 *
 * @return Return the number of services started
 */
int
serviceStartAll()
{
SERVICE	*ptr;
int	n = 0;

	ptr = allServices;
	while (ptr)
	{
		n += serviceStart(ptr);
		ptr = ptr->next;
	}
	return n;
}
Ejemplo n.º 3
0
void WINAPI service_main(int argc, TCHAR* argv[]) {
    s_sHandle = RegisterServiceCtrlHandler(SERVICE_NAME, service_ctrl);
    if (!s_sHandle) {
        goto clean;
    }
    s_status.dwServiceType = SERVICE_WIN32_OWN_PROCESS;
    s_status.dwServiceSpecificExitCode = 0;

    if (!reportStatusToSCM(SERVICE_START_PENDING, NO_ERROR, 3000))
        goto clean;

    serviceStart(argc, argv);

clean:
    if (s_sHandle) {
        reportStatusToSCM(SERVICE_STOPPED, s_dwErr, 0);
    }
}
Ejemplo n.º 4
0
void debugService(int argc, TCHAR* argv[]) {
    bDebug = TRUE;

    int pArgc;
    TCHAR** pArgv = 0;
#ifdef UNICODE
    pArgv = CommandLineToArgvW(GetCommandLineW(), &pArgc);
    if (pArgv == NULL) {
        _tprintf(_T("CommandLineToArgv returned NULL \n"));
        return ;
    }
#else
    pArgc = (DWORD)argc;
    pArgv = argv;
#endif

    _tprintf(_T("Debugging %s.\n"), SERVICE_DISPLAYNAME);
    SetConsoleCtrlHandler(ControlHandler, TRUE);
    serviceStart(pArgc, pArgv);

#ifdef UNICODE
    GlobalFree(pArgv);
#endif
}
Ejemplo n.º 5
0
void MainWindow::serviceStartit()
{
 QTimer::singleShot(1000,this,SLOT(serviceStart()));
}