Beispiel #1
0
char* KillProcessByPIDFn(const char* name, State* state, int argc, Expr* argv[]) {
    if (argc != 1)
        return ErrorAbort(state, "%s() expects 1 arg, got %d", name, argc);
    char *pidfile;
    int retval;
    if (ReadArgs(state, argv, 1, &pidfile) < 0)
        return NULL;

    kill_processes_by_pidfile(2, pidfile);
    kill_processes_by_pidfile(9, pidfile);
    return strdup("t");
}
Beispiel #2
0
static void KillByPidFileFn(UpdaterInfo* pUI, TOKENINFO* pTokens, int nTokens,
		int nLineNo)
{
	int signal = get_signal(pTokens[1].pString);

	fprintf(pUI->log_fp, "Killing process by PID file %s with signal %s\n",
			pTokens[2].pString, pTokens[1].pString);
	kill_processes_by_pidfile(pUI->log_fp, pTokens[2].pString, signal);
	setCallbackData(pUI, strdup(""));
}