LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Red Hat (https://www.linuxquestions.org/questions/red-hat-31/)
-   -   creating a RH9 startup service (https://www.linuxquestions.org/questions/red-hat-31/creating-a-rh9-startup-service-127340/)

fritz101 12-19-2003 02:39 PM

creating a RH9 startup service
 
I have a RedHat 9 server that runs a java appliction, which we start with a begin.bat file. I want to run the bat file at startup, so I added it to rc.local. It ran, but didn't work correctly. The reason is because we usually start it from the directory that the bat file is in, and it references some needed files within that same directory. How do I make the rc.loacal run the bat file from the directory its in, or where do I add the path to make it work?

Ultimately, I would like to be able to run it with a script at startup (with the start, stop, restart options) but have no idea how to write one. Basically, it just needs to run the .bat file to start, and kill the java process to stop.

Thanks in advance for any suggestions.

david_ross 12-19-2003 02:56 PM

Welcome to LQ.

Juat add a cd statement taking you to that directory before the script is run.

fritz101 12-19-2003 03:57 PM

Well that was easy enough. I didn't know it acted just as a terminal session and would accept a cd command. Appreciate the quick response - this site looks like it'll be quite helpful. Thanks!

As far as creating a service script, anyone know of a good resource or guide other than learning a bunch of PERL?

david_ross 12-20-2003 10:30 AM

Most service scripts in redhat are bash and not perl and in redhat use the functions script to generate the OK and FAILED messages.


All times are GMT -5. The time now is 06:40 AM.