LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-06-2006, 06:50 AM   #1
dsids
Member
 
Registered: Mar 2006
Distribution: FC4
Posts: 184

Rep: Reputation: 31
script to load software during boot time


Hi,
I wrote a simple script to start a software (scarab-1.20b) from the script rather than manually starting scarab from the CLI as it requires a couple of commands to be executed first.

I thought of putting the script in /etc/rc.d/rc.local. But when the script was run during booting, it started outputting errors. After a close look i realised that javac was not loaded. Scarab-1.20b requires javac to function.
Now I was wondering where to put the script, so that scarab is automatically started.

Thanks
Danish
 
Old 11-06-2006, 07:21 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
well /etc/rc.local is the right place for sure. it basically just sound slike a path issue or something... javac it just a java comnpiler, it's not a service or anything, so probably just that they way you added the detail to rc.local it could not find the javac binary. you can easily change your PATH variable for that with PATH=$PATH:/where/javac/binary/lives and you'll probably be fine. you may have similar issues with that whole nasty java CLASSPATH stuff, but again, just replicate what works in your normal user environment.
 
Old 11-06-2006, 07:43 AM   #3
dsids
Member
 
Registered: Mar 2006
Distribution: FC4
Posts: 184

Original Poster
Rep: Reputation: 31
Great. Your help works. I just added the javac path in the scarab script and restarted the machine. Everything worked smoothly.

But, still I was wondering if I could add the scarab script into the /etc/rc.d/init.d directory as when I do
#init 6
all the services started are stopped by the init daemon (please correct me if im wrong). But scarab is not stopped as a service.

I did a
# chkconfig --add /danish_script/scarab.sh
error reading information on service /danish_script/scarab.sh: No such file or directory

Please advise

Thanks
Danish
 
Old 11-06-2006, 07:52 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
you would need a formal sysVinit script to trun it into a controllable service. these *can* be very complicated but if you're already doing what you want from a command line you should be ok. what i do is find a simple enough looking script that is already in the init.d directory and just modify where appropriate. you'll probably notice that most sysVinit implementations use a library of backup functions to do various tasks, often /etc/init.d/functions, such as killing processes, so often the script itself can seem odd as much of the routine work is factored out to generic bash functions elsewhere.
 
  


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
how to get ndiswrapper to load at boot time master Linux - Wireless Networking 3 02-25-2006 05:33 PM
Load module at boot time hguts Programming 1 01-24-2006 10:02 AM
how to load a module at boot time appas Linux - Software 7 09-29-2004 07:04 AM
how to load a module at boot time trutnev Linux - Newbie 1 03-14-2004 01:54 PM
Load module(s) at boot time LordChaos Linux - General 2 01-18-2003 04:28 PM


All times are GMT -5. The time now is 04:14 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