LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


Reply
  Search this Thread
Old 03-10-2010, 09:19 PM   #1
neverland
Member
 
Registered: Mar 2010
Posts: 31

Rep: Reputation: 15
start service at boot time on debian4


Hi, I am using Debian4 and I have apache under /home/apache/bin/apachectl
How to start the apachectl service for every time system restart, It
must be start automatically. Please tell me how to
do or how to write the script, how to configure for
run level 2,3 and 5.

Regards
 
Old 03-11-2010, 02:02 AM   #2
ripp3r
Member
 
Registered: Feb 2010
Location: Switzerland
Distribution: Slackware 13.0 x64
Posts: 71

Rep: Reputation: 15
Hi,

This is not the right section, anyway, the solution could be this:

In the file /etc/rc./rc.local add this line

/usr/local/apache2/bin/apachectl start


I'm not sure it can works... but as said, ask to the right section.
 
Old 03-11-2010, 04:10 AM   #3
samac
Senior Member
 
Registered: Mar 2004
Location: Kirkwall, Orkney
Distribution: Linux Mint 20.3 - Cinnamon
Posts: 1,425

Rep: Reputation: 139Reputation: 139
Debian uses a different init system (systemV as opposed to BSD style scripts) to Slackware, you will more likely find the correct answer in the Debian forum quicker.

samac

Last edited by samac; 03-11-2010 at 04:12 AM.
 
Old 03-11-2010, 05:06 AM   #4
ponce
LQ Guru
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 7,097

Rep: Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174Reputation: 4174
http://wiki.linuxquestions.org/wiki/Update-rc.d
 
Old 03-11-2010, 06:28 AM   #5
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
Quote:
Originally Posted by neverland View Post
Hi, I am using Debian4 and I have apache under /home/apache/bin/apachectl
How to start the apachectl service for every time system restart, It
must be start automatically. Please tell me how to
do or how to write the script, how to configure for
run level 2,3 and 5.
I'd say the quickest way to achieve this is probably:
Code:
ln -s /home/apache/bin/apachectl /etc/init.d/apachectl
sysv-rc-conf --level 235 apachectl on
If you need arguments (or anything else), substitute a script for the link.

If you don't have sysv-rc-conf already installed, well, it's only an apt-get install away!

Last edited by win32sux; 03-11-2010 at 07:00 AM.
 
Old 03-11-2010, 06:50 AM   #6
XavierP
Moderator
 
Registered: Nov 2002
Location: Kent, England
Distribution: Debian Testing
Posts: 19,192
Blog Entries: 4

Rep: Reputation: 475Reputation: 475Reputation: 475Reputation: 475Reputation: 475
Moved: This thread is more suitable in Debian and has been moved accordingly to help your thread/question get the exposure it deserves.
 
Old 03-11-2010, 10:29 PM   #7
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,724

Rep: Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705Reputation: 1705
You have to write the script. The easiest approach would be to start with the /etc/init.d/apache script used in the Debian apache package: then modify it. Then you can use rcconf or similar (or make the links yourself) to get it to start and stop at the runlevels you desire.

Easier still would be to simply install the Debian apache package. Any special reason you didn't?

Cheers,

Evo2.
 
  


Reply



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
Service Start Date and Time - Red Hat Enterprise Linux 5.x asimba Linux - Enterprise 2 08-12-2009 07:37 AM
How to start a service at boot time. swamprat Linux - Newbie 4 07-03-2009 01:03 PM
how to set a service to start any time the system reboot phongly2000 Linux - Newbie 3 01-16-2009 11:48 AM
start the service for every boot time yuva_mca Linux - General 3 03-09-2004 01:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 04:58 PM.

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
Open Source Consulting | Domain Registration