I have an executable file odo.elf that I need to start in a daemon process on a Micozed board (Petalinux distribution). Here is the executable to start|stop|restart the daemon
#!/bin/sh
DAEMON=/mnt/flash/bin/odo.elf
start ()
{
echo "Starting Odo"
start-stop-daemon -S -o -x $DAEMON > /var/log/odo.log &
}
stop ()
{
echo " Stopping odo"
start-stop-daemon -K -x $DAEMON
}
restart()
{
stop
start
}
[ -e $DAEMON ] || exit 1
case "$1" in
start)
start; ;;
stop)
stop; ;;
restart)
restart; ;;
*)
echo "Usage: $0 {start|stop|restart}"
exit 1
esac
exit $?
After starting the process by line command ' odo start' and after opening the log file 'tail -f /var/log/odo.log' I see that the output is displayed with a delay. If I execute odo.elf by command line (with './odo.elf') the stdout is in real time while when I start odo.elf via daemon process the writing on the log file is not in real time.
So far I cannot find any solution Any suggestion, please? Thank you in advance