Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - General
User Name
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.


  Search this Thread
Old 04-21-2005, 12:21 PM   #1
LQ Newbie
Registered: Jun 2004
Posts: 23

Rep: Reputation: 15
startup script

Hi all, can i know how to write a startup script which has to get started when the computer boots up. Like If i want to start apache service at bootup where should i write the command
/usr/local/apache/bin/httpd start so that it gets started automatically when the computer boots up. Can anyone help me out.

Thanks and bye
Old 04-21-2005, 12:46 PM   #2
Senior Member
Registered: Apr 2005
Location: BrewCity, USA (Milwaukee, WI)
Distribution: Xubuntu 9.10, Gentoo 2.6.27 (AMD64), Darwin 9.0.0 (arm)
Posts: 1,152

Rep: Reputation: 46
Sounds like you looking for something like autoexec.bat. nothing quite like it in linux. Try to enable the sevice with chkconfig or your distro's configuration utility (I use SuSE so for me that's yast2 but I don't know what you use.) the .profile file in your home directory is called when you log in and, /etc/profile.local when anybody logs in. but starting stuff at boot time is more complicated then dos. (unix systems having multiple runlevels and all.) I don't use apache so this might not work but, try (as root):

chkconfig httpd on

Last edited by johnson_steve; 04-21-2005 at 12:48 PM.
Old 04-21-2005, 12:50 PM   #3
Registered: Feb 2004
Posts: 781

Rep: Reputation: Disabled
Take a look at this post.

Greetz, Boby!
Old 04-21-2005, 12:51 PM   #4
Registered: Apr 2005
Distribution: Becoming Sid
Posts: 142

Rep: Reputation: 16
Try /etc/rc.d/rc.local

If you are using debian take a look at:
Old 04-21-2005, 05:22 PM   #5
LQ Newbie
Registered: Jun 2004
Posts: 23

Original Poster
Rep: Reputation: 15
Thanks its working .......


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 On
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
'cannot stat' script in /etc/rc.d/, try to run script at startup quintan Linux - Software 1 11-21-2005 03:53 AM
How to call a script from a system startup script? jonatito Linux - Newbie 7 11-11-2005 10:40 PM
startup script ... again. Vindane Linux - Wireless Networking 2 03-04-2005 03:57 AM
Script at startup rohde Linux - Newbie 2 09-12-2004 10:32 AM
startup script djinniyah Linux - Newbie 2 09-18-2003 06:07 AM > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 03:08 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration