crm_err("start_a_child_client: Cannot fork.");
crm_err("Cannot fork.");
start_subsystem(struct crm_subsystem_s*	centry){	pid_t       pid;	struct stat buf;	int         s_res;	crm_info("Starting sub-system \"%s\"", centry->command);	if (centry->pid > 0) {		crm_err("OOPS! client %s already running as pid %d"		       ,	centry->command, (int) centry->pid);	}	/*	 * We need to ensure that the exec will succeed before	 * we bother forking.  We don't want to respawn something that	 * won't exec in the first place.	 */	if (access(centry->path, F_OK|X_OK) != 0) {		cl_perror("Cannot (access) exec %s", centry->path);		return FALSE;	}	s_res = stat(centry->command, &buf);	if(s_res != 0) {		cl_perror("Cannot (stat) exec %s", centry->command);		return FALSE;	}		/* We need to fork so we can make child procs not real time */	switch(pid=fork()) {		case -1:			crm_err("start_a_child_client: Cannot fork.");			return FALSE;		default:	/* Parent */			centry->pid = pid;			return TRUE;		case 0:		/* Child */			break;	}	/* Child process:  start the managed child */	cl_make_normaltime();	setpgid(0,0);	/* Limit peak resource usage, maximize success chances */	if (centry->shortrcount > 0) {		alarm(0);		sleep(1);	}	crm_info("Executing \"%s\" (pid %d)",	       centry->command, (int) getpid());	if(CL_SIGINTERRUPT(SIGALRM, 0) < 0) {		cl_perror("Cannot set interrupt for child process %s",			  centry->command);	}else{		const char *	devnull = "/dev/null";		unsigned int	j;		struct rlimit		oflimits;		CL_SIGNAL(SIGCHLD, SIG_DFL);		alarm(0);		CL_IGNORE_SIG(SIGALRM);		/* A precautionary measure */		getrlimit(RLIMIT_NOFILE, &oflimits);		for (j=0; j < oflimits.rlim_cur; ++j) {			close(j);		}		(void)devnull;				(void)open(devnull, O_RDONLY);	/* Stdin:  fd 0 */		(void)open(devnull, O_WRONLY);	/* Stdout: fd 1 */		(void)open(devnull, O_WRONLY);	/* Stderr: fd 2 */		(void)execl("/bin/sh", "sh", "-c", centry->command, (const char *)NULL);		/* Should not happen */		cl_perror("Cannot exec %s", centry->command);	}	/* Suppress respawning */	exit(100);	/* never reached */	return TRUE;}