LinuxQuestions.org
Review your favorite Linux distribution.
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 12-01-2004, 11:35 AM   #1
merlin23
Member
 
Registered: Dec 2004
Location: Vienna
Posts: 46

Rep: Reputation: 15
start services at startup automatically


Hello!

Could anyone explain me how i can configure services at startup?
I have an apache installed and want it to automatically start at the beginning.
I use Mandrake linux, but I have compiled the sources myself and now I don't
find them in the graphical configuration tool (where you can turn off/on the services) from mandrake.

So I start them always in the command line, but i couldn't find out how to make it start at boottime, maybe I have to put it in the init.d/ directory and link it to rc.d4/ (if I am in runlevel 4) ?
 
Old 12-01-2004, 11:54 AM   #2
sigsegv
Senior Member
 
Registered: Nov 2004
Location: Third rock from the Sun
Distribution: NetBSD-2, FreeBSD-5.4, OpenBSD-3.[67], RHEL[34], OSX 10.4.1
Posts: 1,197

Rep: Reputation: 46
Re: start services at startup automatically

Quote:
Originally posted by merlin23

So I start them always in the command line, but i couldn't find out how to make it start at boottime, maybe I have to put it in the init.d/ directory and link it to rc.d4/ (if I am in runlevel 4) ?
Exactly right.

Installing from the distro's package might be a better option though, as that way you'll be able to track updates with the rest of the system.
 
Old 12-01-2004, 12:02 PM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 11,764

Rep: Reputation: 719Reputation: 719Reputation: 719Reputation: 719Reputation: 719Reputation: 719Reputation: 719
http://linux.about.com/library/cmd/b..._chkconfig.htm

The start/stop scripts are stored in init.d. When you add the service via chkconfig that will create a link in the approiate rc.d directory.

Or you can add a line in the rc.local file to start a service.
 
Old 12-01-2004, 04:27 PM   #4
Captain Crash
LQ Newbie
 
Registered: Dec 2004
Distribution: mandrake 9.1
Posts: 1

Rep: Reputation: 0
i have a similar problem or maybe not
I'm kinda new to this so please bear with me
I'm running mandrake 9.1 on my PC
when i boot the network service or interface doesn't come up
However when i go into mandrake control center i can run drake connect and start the network interface which afterward it works.
i can tell by running /sbin/ifconfig from rxvt before and after i run drake connect
i dont have this problem on my laptop which is running the same distro.
can any body help me?
 
Old 12-02-2004, 04:31 AM   #5
merlin23
Member
 
Registered: Dec 2004
Location: Vienna
Posts: 46

Original Poster
Rep: Reputation: 15
I have the same problem, too... (though 1st priority is the problem above for me in meanwhile)..If I can figure anything out about it, I will come back and post it...
maybe some guru has some nice hints?

To the 1st problem from above:

How do I create such a start/stop script for my etc/init.d ?
Do I just have to write into a file the command "/usr/local/apache/bin/apachectl start" and make it executable??


Last edited by merlin23; 12-02-2004 at 04:35 AM.
 
Old 12-15-2004, 07:43 AM   #6
merlin23
Member
 
Registered: Dec 2004
Location: Vienna
Posts: 46

Original Poster
Rep: Reputation: 15
I've recognized that after bringing up the networkcard with drake, it now seems to start up automatically everytime I reboot...

What me makes worry is this httpd daemon...
Because I compiled it by source, I don't know how to do this with drake...

so maybe somebody could give me a hint to my question from above ?




Quote:
How do I create such a start/stop script for my etc/init.d ?
Do I just have to write into a file the command "/usr/local/apache/bin/apachectl start" and make it executable??
Is it a normal shell-script I need to write??

EDIT:
Ok, I reread the thread...I think I will give it a try and append it to my /etc/rc.d/rc.local script to the end:

/usr/local/bin/apachectl start

hope this will work, the next reboot will be tomorrow...anyway, I 'd be very interested how this works with the runlevel-dircetories...

Write shell-script to /etc/init.d and then link it to rc5.d (for runlevel 5) , is this correct so??

Last edited by merlin23; 12-15-2004 at 07:50 AM.
 
Old 01-26-2005, 07:10 AM   #7
houdelou
Member
 
Registered: Nov 2004
Location: Canada
Distribution: Ubuntu
Posts: 44

Rep: Reputation: 15
you probably have already a script to start apache on your computer. Look in /etc/rc.d/rc.httpd. If this script exists, just change the permissions so that it can be read and executed. chmod 755 /etc/rc.d/rc.httpd. If it does not exist on your computer, try to find one on apache web page or elsewhere on the internet.
 
Old 01-28-2005, 07:03 AM   #8
merlin23
Member
 
Registered: Dec 2004
Location: Vienna
Posts: 46

Original Poster
Rep: Reputation: 15
thx a lot, I'll give it a try soon...

nethertheless, the way described before worked very well, I just have appended the command "apachectl start" to the rc.local ...

What I suggest is now, that I could simple create a file rc.httpd and put that command into it ?
Would this work also?


Last edited by merlin23; 01-28-2005 at 07:05 AM.
 
Old 01-28-2005, 02:09 PM   #9
houdelou
Member
 
Registered: Nov 2004
Location: Canada
Distribution: Ubuntu
Posts: 44

Rep: Reputation: 15
yes, anything you put in /etc/rc.d starting with rc. is run at startup. The file has to be executable also. Here is the content of script that was installed by default in my /etc/rc.d/rc.httpd


#!/bin/sh
#
# /etc/rc.d/rc.httpd
#
# Start/stop/restart the Apache web server.
#
# To make Apache start automatically at boot, make this
# file executable: chmod 755 /etc/rc.d/rc.httpd
#

case "$1" in
'start')
/usr/sbin/apachectl start ;;
'stop')
/usr/sbin/apachectl stop ;;
'restart')
/usr/sbin/apachectl restart ;;
*)
echo "usage $0 start|stop|restart" ;;
esac


As you can see, it is very alike but with a little more options. (restart is very useful).
 
Old 06-30-2013, 02:52 AM   #10
CodeFreaker
LQ Newbie
 
Registered: Feb 2010
Posts: 27

Rep: Reputation: 12
Smile

Quote:
Originally Posted by merlin23 View Post
Hello!

Could anyone explain me how i can configure services at startup?
I have an apache installed and want it to automatically start at the beginning.
I use Mandrake linux, but I have compiled the sources myself and now I don't
find them in the graphical configuration tool (where you can turn off/on the services) from mandrake.

So I start them always in the command line, but i couldn't find out how to make it start at boottime, maybe I have to put it in the init.d/ directory and link it to rc.d4/ (if I am in runlevel 4) ?
You can use chkconfig command in redhat.

eg:
chkconfig --level 35 sshd on

--level you can define which level the service should run at start up.This it runs at 3 and 5.run chkconfig you can see the list of services and run level configured at startup.
 
Old 06-30-2013, 04:48 AM   #11
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,225

Rep: Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021Reputation: 2021
You know this thread was from 2004/2005?
 
  


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
startup services kola Fedora 2 12-02-2004 05:47 PM
Start services automatically (httpd & SMB) krazyglue Linux - Newbie 8 07-11-2004 03:48 AM
how to make named start automatically at startup nazzymac *BSD 3 04-20-2004 10:58 AM
how to auto start services at startup in debian? legolin Debian 3 12-28-2003 10:02 AM
Startup Services Stephanie Linux - General 2 08-07-2001 09:37 AM


All times are GMT -5. The time now is 02:27 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration