EDIT: Changed the title as the problem was misunderstood. I run the application automatically at startup but this is not my problem. My problem is that I cannot run Linux system command using popen() when the application is started up automatically, as I try to explain below.
I use popen() to run linux system command in a Qt C++ application to get information regarding my network connection, such as HW address, IP, mask, gateway, DHCP (if used).
To get this information I run the linux system command from my c++ code (assuming the ethernet adapter is eth0) : "nmcli dev list iface eth0".
This works fine in my test environment when I am (of course) logged in as a user.
However, the intention is that my application shall be set up to run right after boot in the background without the need to log in. This is working fine - my application starts after boot as expected.
BUT I am not able to run my Linux system command to get the network information I require. Is there any way to get around this? Can I call the system command from my c++ code in another manner or is there another way to get the required information?
The whole idea is that the application is run on a Linux box without the end-user having access the system, hence the reason for running without logging in.