I have an executable program /home/user/foo with root and executable permissions. The foo has 3 threads and performs outputs using printf. This program is placed in embedded target with Linux, 4.1.22-ltsi. I need to run the foo automatically on target startup. For that I added the following line in file /etc/rc.local

# new line 
/home/user/foo > /dev/ttyS0 &
#old line 
exit 0

As the result, the foo runs, but there is problem with printings. The prints appears after starting rc.local

Starting /etc/rc.local  Compatibility ...

but has been disappear after reboot complete. Just after reboot output

Debian GNU/Linux 9 linaro-developer ttyS0

the prints are eliminated. The command

 ps -aux | grep foo

shows that tty is ? Also, I checked current tty' console:

$ tty

I also tried some other options in the rc.local, but them do not output at all:

/home/user/foo 2>&1 &


/home/user/foo &

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.