Cannot get output from cm during boot



I’d like get output from cm command in an application launched on boot but I get nothing.

I use the following code:

do {
	/* Open the command for reading. */
	fp = popen("cm info fsn", "r");
	if (fp == NULL) {
		syslog(LOG_ERR,"Failed to run command\n" );

	fgets(result, sizeof(result), fp);
	trimmed = trim(result);
	syslog(LOG_NOTICE,"cm info fsn result %s\n", trimmed);
	/* close */
} while ((strstr(trimmed, "LL") == NULL) && (check++ < 5));

And so, I didn’t get anything in result.
Here I try with cm info fsn but the problem is the same for any other cm command in fact.
But if I replace cm info fsn by date , I do read the output of date.

I have this problem only if the application is started from the init script and even if the cm command is invoked long time after boot up.

If I start the aplication manually from bash, it’s OK.
Any idea?


Please try using the fully qualified path to cm “/legato/systems/current/bin/cm”