LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to add programs to startup after reboot.... (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-add-programs-to-startup-after-reboot-739813/)

ringding 07-13-2009 02:40 PM

How to add programs to startup after reboot....
 
I have 2 services I need to start upon reboot...here are the commands I am currently using from the terminal:

/usr/local/apache2/bin/apachectl start
and
/var/jboss43/jboss-as/bin/run.sh -c jboss01 -b taxjbc29.globaltax.ge.com &

Do I simply put these commands in rc.local? If so How? Iread somewhere that you enter commands as you would in a terminal?

Redhat AS 4
Thanks

fbianconi 07-13-2009 02:57 PM

look here:

http://www.fedorafaq.org/basics/#startonboot

is not red hat, but can't be too different

ringding 07-13-2009 03:01 PM

Quote:

Originally Posted by fbianconi (Post 3606460)

My commands do not start with...well...a command...they start with a directory path...so do the commands need to start with a real command that lives in the environment variable?

Could these commands be chkconfig'd

fbianconi 07-13-2009 04:04 PM

It's normal for commands to start with the path. Otherwise the shell should look for them in the paths in the $PATH variable of the shell. It is not just fine, but better to point with the full path when you want to make sure that "those files" should be executed, and not others with the same name. It's THE way to go (specially when extra security is needed).

Quote:

Do I simply put these commands in rc.local? If so How? Iread somewhere that you enter commands as you would in a terminal?
yes, exactly.

also you might (as in "I'm not sure if it's needed") have to make it executable by changing the permissions with chmod +x <file>

chrism01 07-13-2009 08:51 PM

The apache one should be chkconfig'd in RH, assuming you installed using the RH tools, not by hand.

iirc, its called 'httpd' rather than apache as far as chkconfig is concerned.

viGeek 07-13-2009 10:44 PM

I would put them in rc.local, that would be the best place IMO, it's executed during the final boot phase thus any confrontation would be minimal amongst services and resources.


All times are GMT -5. The time now is 11:50 PM.