adding job to init.d tasks
Posted on 2003-03-06
I want to get my machine to automatically start a certain shell script on startup. The shell script sets a few variables and starts a java program that I want to run continuously. I can get the actual service to start (using 'service foo start' successfully (if I get the java program to run in the background in the script by prefixing the command with &) However, the stopping is proving more problematic, as I'm not quite sure what mechanism I should use to tell the service what the pid of the service to stop should be (because the actual called shell script ends if the java program is put into the background). Does anyone know how I should approach this problem, or better still have links to any online resources about how to setup this kind of service?