Thread: init.d bootup how to run .jar containing infinite loop
i've requirement of executing jar file containing endless loop, should start executing when server boot , should continue executing until server halt.
created file named "bu" containing
#!/bin/sh
java -jar /home/samara/nano/bu.jar
@ /etc/init.d
, created link script at: /etc/rc2.d
using code:
sudo ln -s /etc/init.d/bu /etc/rc2.d/s90bu
chmod file : sudo chmod 755 /etc/init.d/bu
rebooted using: sudo reboot
==========================
when server boot-up
displays console output of jar file every loop execution.
need script running separate thread in cpu , boot system
starting apache2 on boot-up
appreciated.
i think found solution
added "&" @ end of script
server start , file executing no problem
new script looks exactly:
#!/bin/sh
java -jar /home/samara/nano/bu.jar &
if there way better please let me learn that.
thank you.
Forum The Ubuntu Forum Community Ubuntu Specialised Support Ubuntu Servers, Cloud and Juju Server Platforms [ubuntu] init.d bootup how to run .jar containing infinite loop
Ubuntu
Comments
Post a Comment