LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 12-19-2003, 03:39 PM   #1
fritz101
LQ Newbie
 
Registered: Dec 2003
Posts: 5

Rep: Reputation: 0
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.
 
Old 12-19-2003, 03:56 PM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 66
Welcome to LQ.

Juat add a cd statement taking you to that directory before the script is run.
 
Old 12-19-2003, 04:57 PM   #3
fritz101
LQ Newbie
 
Registered: Dec 2003
Posts: 5

Original Poster
Rep: Reputation: 0
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?
 
Old 12-20-2003, 11:30 AM   #4
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

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


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
creating own service cranium2004 Programming 1 03-02-2005 10:11 PM
creating own service cranium2004 Linux - Newbie 1 03-02-2005 10:00 PM
Startup Programs as a Service? keithieopia Linux - Newbie 4 02-26-2005 10:44 PM
XFS service in RH9 startup... what is it? Thaidog Linux - Newbie 1 09-19-2003 08:25 AM
Creating a Service JCScoobyRS Linux - General 40 03-03-2003 06:20 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 08:52 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration