I made small java app for logging users by ID. It reads input using System.in.read() in loop and on Enter key it saves readed string to log file with actual date and time as a new line (its designed for use with RFID reader). Each readed symbol is also printed to stdout prefixed with Readed: App works fine when is started by command java -jar app.jar.I want to start this app automatically after system boot so I add start script into /etc/init.d/And there is a problem. App is started, but it runs on background. When I redirect stdout to file via java -jar app.jar >> log.txt in start script, after reboot and open log file there are many lines with string Readed:  folowed by non-ascii character, and lines count is growing by a thousands every minute.I am not able to redirect standard input into this app.Is there any possibility how to automatically run app in default console with standard input from console when system boots in command-line mode (without GUI)?EDIT:I expect the same behavior like with this script named autorun.sh located on Desktop:#!/bin/bashecho Enter ID  read text  while [ $text != END ]do     echo $text    read textdonewhich is started using rfid.desktop file located in /home/pi/.config/autostart which contains:[Desktop Entry]Type=ApplicationExec=lxterminal -e sudo sh /home/pi/Desktop/autorun.shHidden=falseNoDisplay=falseX-GNOME-Autostart-enabled=trueBut with java app instead of autorun.sh script.I very appreciate any help or advice.
Run java console app reading standard input after boot
java;raspbian