LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Autostart an application after CentOS 4.4 reboots (https://www.linuxquestions.org/questions/linux-newbie-8/autostart-an-application-after-centos-4-4-reboots-785398/)

pacman34 01-28-2010 11:32 AM

Autostart an application after CentOS 4.4 reboots
 
Hello-

I am fairly new to linux. We have a machine running CentOS 4.4 and sometimes the machine has to be rebooted. Each time after the reboot, I have to SSH in and manually restart one of our application.

I have been reading about doing this online and I am a little confuse.
Seems like there are multiple possibilities for starting things up.

My finding suggest using the inittab file. Then my question is what runlevel do I pass in? Should I use runlevel 1, 2, 3, or 5? Once the runlevel is determine, then how should I name my startup script? I know to use "S" but what number should I give it?

Or, another way to approach this is to put my autostart script in the /etc/rc.local file?

Much thanks for any suggestions.

AM

ncsuapex 01-28-2010 12:07 PM

What application is it? If it's a service you can use chkconfig to set it to start at varying runlevels.

It all depends on what the app is and what it does and when it needs to start. ie Does it need to start before or after the network connection? Is it dependent on another service to already have been started?


There's a thousand ways to do stuff in Linux but we have to know what you're trying to do.

pacman34 01-28-2010 12:10 PM

The application is an IRC messaging or chat client. So, it will need to start after the network connection. Thanks.

ncsuapex 01-28-2010 02:40 PM

should be able to stick your start command in /etc/rc.d/rc.local. Use the full path location: ie

/usr/sbin/startIRC or whatever the location/name is plus and flags you need.

pacman34 01-28-2010 03:04 PM

Yeah. Thanks for the reply. I decided to go ahead and put my startup script the etc/rc.d/init.d directory and ran the command chkconfig --add my_script_file.


All times are GMT -5. The time now is 10:16 PM.