Contact Us
    SearchSearch   RegisterRegister   Log inLog in 

Auto StartUp script and option in Linux

Auto StartUp script and option in Linux

Post new topic   Reply to topic     Forum Index -> Linux os
View previous topic :: View next topic  
Author Message

Joined: 28 Jun 2008
Posts: 154

PostPosted: Wed Aug 20, 2008 4:02 pm    Post subject: Auto StartUp script and option in Linux Reply with quote

Can anyone provide me idea of how to startup my particular program automatically when Linux (Red hat, fedora, CentOS) system is starting.
I search but i didn't get anyone. I have some program tomcat and some other program which need to start automatically when server started.
Back to top
View user's profile Send private message
Site Admin

Joined: 20 Jul 2008
Posts: 77

PostPosted: Fri Oct 10, 2008 5:03 pm    Post subject: Reply with quote

Like windows linux dont have startup option where you can put your exe or scripts or program to run automatically when computer is booting. But linux also provide so many facilities instead of same exact thing. Auto startup option can be achieve by using cron option where you can set particular time schedule for any script. It will run automatically at that time.

If you want to start application at booting time. You can use run level of linux. There are different run levels rc 3 or 5 normally use for starting computer.

Suppose we have tomcat and want to run automatically shell script. we have to follow

1 Check first Runlevel

If 5 or 3
Rc5.d for 5 and rc3.d for 3 level
2 go in directory
# cd /etc/rc5.d/

Check last process id
# ls –li

3 next to make soft link (windows like shortcuts)
# ln –s /tomcat/bin/ S100tomcatd

4 again make soft link in init.d folder
#cd /etc/init.d

# ln –s /tomcat/bin/ tomcatd

5 Check status of process
#service tomcatd status

if you want to do next auto start process

Apache auto start
1. Check runlevel
2. #runlevel
3. #Cd /etc/rc5.d
4. Check now last process in this folder
5. # ln –s /usr/local/httpd/bin/apachectl S101httpd
6. #cd /etc/init.d
7. # ln –s /usr/local/httpd/bin/apachectl httpd

Above all was to starting computer run level but if you want to shutdown services when computer is shutting down. You need to do same thing but at different run level
Runlevels 0 and 6 are used for halting and rebooting the system
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Linux os All times are GMT
Page 1 of 1

Jump to:  
  Quick Post a Reply Topic
  Name (required)  
  Email Address (will not be published) (required)  
  Subject of topic (required)  

  More Links  
JSP Introduction
JSP Setup
Simple JSP Example
JSP Variable
Array Declaration in JSP
JSP Forms and User Input
Form Validation
JSP Cookies
JSP Session Object
Loop, content collection, iterator, conditional check in JSP
JSP Application Object
JSP Include
JSP Response Object
JSP Request Object
JSP Error Handling
JSP File Handling Object
JSP Action Tag
JSP Implicit Objects
JSP Declaration
JSP Directive
JDBC Introduction
JDBC Driver
JDBC Connection
JDBC Prepared/Statement
JDBC ResultSet
JDBC Close Connection object
JDBC Insert
JDBC Display Records
JDBC Update
JDBC Delete
JDBC Sorting
JDBC Query
JDBC Exception
JDBC Add Batch
JDBC Transaction/RollBack