Which image are you using on your board? Could you run the command uname –a on the Terminal Console and let us know the outcome? I would like to replicate your environment to test this.
Also, are you transferring the code through a SD card? Why don’t you use the executable that the board loads from the Eclipse?
Are you able to run the executable on the board?
I'm using the Linux Edison 3.10.17-poky-edison image. No it's all running from eclipse, but I changed the absolute path in eclipse to that location instead of the tmp folder. I was setting it up so that I could have a script that started running the program from that location. I'm not 100% about your last question. I know it runs when I press run on eclipse but I don't know how to run it just from the board.
I was able to create a service with a C++ code from Eclipse.
I am using the 3.5 release, you can check this by running the command uname –a on the Terminal Console, the latest image should has as output:
Linux jarvis35 3.10.98-poky-edison+ #1 SMP PREEMPT Mon Jun 6 14:32:08 PDT 2016 i686 GNU/Linux, and the Eclipse Luna SR2 (4.4.2) version.
I used the C/C++ Project > On board LED blink C++ example and used the name code as Project Name
As you know, once you connect the board and run the script, you can see the executable in /tmp. In my case I saw the file code in /tmp. What I did was to cp the file in /home/root
Then, I created a service named code.service in /lib/systemd/system with the following content:
[Unit] Description=BlinkcodeService After=network.target [Service] ExecStart=/home/root/code Restart=always [Install] WantedBy=multi-user.target
After this, you need to run the commands:
systemctl start code.service
systemctl enable code.service
Try with this steps and let me know the outcome, I hope it works for you too.