I am trying to automatically collect how long the system took to boot up. The I am working on a cpp code that has been configured as one of the systemd service.
I heard systemd-analyze
outputs the boot time information.
And the command works if I execute it on the command line.
But when I tried to execute the command from cpp code using popen.
FILE *fp;
fp = popen("systemd-analyze 2>&1", "r");
I get a output message failed to get timestamp properties: transport endpoint is not connected
.
What does this error mean? and please advise what I can try to fix this issue?
Thank you.