LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 01-28-2010, 12:32 PM   #1
pacman34
LQ Newbie
 
Registered: Jan 2010
Posts: 3

Rep: Reputation: 0
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
 
Old 01-28-2010, 01:07 PM   #2
ncsuapex
Member
 
Registered: Dec 2004
Location: Raleigh, NC
Distribution: CentOS 2.6.18-53.1.4.el5
Posts: 770

Rep: Reputation: 43
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.
 
Old 01-28-2010, 01:10 PM   #3
pacman34
LQ Newbie
 
Registered: Jan 2010
Posts: 3

Original Poster
Rep: Reputation: 0
The application is an IRC messaging or chat client. So, it will need to start after the network connection. Thanks.
 
Old 01-28-2010, 03:40 PM   #4
ncsuapex
Member
 
Registered: Dec 2004
Location: Raleigh, NC
Distribution: CentOS 2.6.18-53.1.4.el5
Posts: 770

Rep: Reputation: 43
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.
 
Old 01-28-2010, 04:04 PM   #5
pacman34
LQ Newbie
 
Registered: Jan 2010
Posts: 3

Original Poster
Rep: Reputation: 0
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.
 
  


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
Autostart Application woes brood1 Linux - Desktop 1 12-17-2008 11:00 AM
Autostart an application that needs to be run as root matt_ttam Linux - Server 2 10-17-2008 02:55 PM
Autostart QT application super_hill Linux - Desktop 3 07-04-2008 02:41 AM
Centos 4 Server Reboots Randomly? Terroth Linux - Software 3 02-28-2006 04:55 PM
Autostart application when logging into X BlackCell Debian 10 03-09-2005 10:07 AM


All times are GMT -5. The time now is 11:10 AM.

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