简体   繁体   中英

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 ?

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM