Thursday, February 12, 2009

Process start and stop, the easy way

Here is a pair of scripts that can be used to start and stop a Java process (or something else) on a Linux/UNIX box using bash:

"start.sh":


nohup /usr/lib/jvm/java-1.6.0-sun/bin/java -jar Pronto-0.1-SNAPSHOT.jar 1> stdout.txt 2> stderr.txt &
echo $! > Pronto.pid


"stop.sh":

kill `cat Pronto.pid`
rm Pronto.pid


Use with caution, these are not production-ready ;-)

1 comment:

5n6t6h883e said...

This is an open access article distributed under the Creative Commons Attribution License, which Bath Sheets permits unrestricted use, distribution, and copy in any medium, provided the original work is correctly cited. A. Daniel, “Friction welding joints of SA 213 tube to SA 387 tube plate boiler grade materials by using clearance and interference fit technique,” Materials Today Proceedings, vol. C. Chandrasekhar, “Effect of tube preparations on joint strength in friction welding of tube-to-tube plate utilizing an external tool course of,” Experimental Techniques, vol. Fatimah, “Study of genetic algorithm to fully-automate the design and coaching of synthetic neural network,” IJCSNS, vol.