I need to run a java jar in server in order to communicate between two application,i have written to shell script to run it ,but once i startup that script i can't shutdown / terminate the process,if i press ctrl+C or close the console ,server will shutdown. any one could help me how do i modify this script to run as normal server ?
java -jar /web/server.jar
You can try this:
#!/bin/sh nohup java -jar /web/server.jar &
The & symbol, switches the program to run in the background.
The nohup utility makes the command passed as an argument run in the background even after you log out.