LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   script to load software during boot time (https://www.linuxquestions.org/questions/linux-newbie-8/script-to-load-software-during-boot-time-499070/)

dsids 11-06-2006 05:50 AM

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

acid_kewpie 11-06-2006 06:21 AM

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.

dsids 11-06-2006 06:43 AM

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

acid_kewpie 11-06-2006 06:52 AM

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.


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