Search code examples
javalinuxbashembeddedboot

Start java application in background automatically after boot on embedded linux


I am using an embedded linux ( Distro: TI SITARA SDK 6.0.0 ) on beaglebone black. I have a java application which runs multiple tcp servers. I need to start this application in background and automatically after every boot. If i login with ssh and run the below code manually (or in bash script) it does work.

nohup java -jar application.jar &>log.txt &

But if i add this in linux init script and reboot it doesn't. If i delete last '&' in the line it does work but system resets after 2-3 minutes.

So how can i start my application after every bootup and not causing a reset ?


Solution

  • I solve this problem with starting my device's watchdog like application in my script. My application works in background but bash scripts stays open until my application stops.