View previous topic :: View next topic |
Author |
Message |
Retriever II Tux's lil' helper
Joined: 07 Sep 2003 Posts: 93 Location: Northampton, MA, USA
|
Posted: Wed Oct 01, 2003 2:20 am Post subject: apache2 won't start on boot |
|
|
Just a small problem, not really critical since I'm only running the webserver for personal use, but it's annoying none the less.
I added apache2 to run default
Code: | rc-update add apache2 default |
That went fine, but every time I restart and it tries to run apache, it complains about the usage and fails to start. Once I login however, I can run the command and get it to start without a peep. What would prevent it from starting during boot?[/code] |
|
Back to top |
|
|
M104 Tux's lil' helper
Joined: 13 Jan 2003 Posts: 132 Location: Riverside, CA
|
Posted: Wed Oct 01, 2003 5:57 am Post subject: |
|
|
What exactly does it say when it complains? You can try a
Code: | rc-update del apache2 default
rc-update add apache2 default |
and see if that clears up dependency issues. The only thing I can think of is that apache is requiring some service that hasn't loaded yet when the apache2 script is run during startup. _________________ "Pulling together is the aim of despotism and tyranny. Free men pull in all kinds of directions."
Terry Pratchett, The Truth |
|
Back to top |
|
|
chrismage n00b
Joined: 01 Oct 2003 Posts: 1
|
Posted: Wed Oct 01, 2003 6:04 pm Post subject: |
|
|
i seem to be having the same problem. i'm fairly certain that the problem lies within the init script. (/etc/init.d/apache2)
here is the output.
Code: |
jabba root # /etc/init.d/apache2 start
* Starting apache2...
Usage: /usr/sbin/apache2 [-D name] [-d directory] [-f file]
[-C "directive"] [-c "directive"]
[-k start|restart|graceful|stop]
[-v] [-V] [-h] [-l] [-L] [-t] [-S]
Options:
-D name : define a name for use in <IfDefine name> directives
-d directory : specify an alternate initial ServerRoot
-f file : specify an alternate ServerConfigFile
-C "directive" : process directive before reading config files
-c "directive" : process directive after reading config files
-e level : show startup errors of level (see LogLevel)
-E file : log startup errors to file
-v : show version number
-V : show compile settings
-h : list available command line options (this page)
-l : list compiled in modules
-L : list available configuration directives
-t -D DUMP_VHOSTS : show parsed settings (currently only vhost settings)
-S : a synonym for -t -D DUMP_VHOSTS
-t : run syntax check for config files [ !! ]
|
|
|
Back to top |
|
|
Retriever II Tux's lil' helper
Joined: 07 Sep 2003 Posts: 93 Location: Northampton, MA, USA
|
Posted: Wed Oct 01, 2003 7:41 pm Post subject: |
|
|
Yeah, that's the message.
However, after doing that for the past three days, I started the computer up this morning, and it randomly decided to work, and I have no idea why. I'll just hope it stays that way. Seems to be the story of all my errors. Just clear themselves up after a few days. |
|
Back to top |
|
|
M104 Tux's lil' helper
Joined: 13 Jan 2003 Posts: 132 Location: Riverside, CA
|
Posted: Wed Oct 01, 2003 8:38 pm Post subject: |
|
|
Is there a new version of the init script waiting to be updated by etc-update? Did you delete the update to the latest version? I'm glad you got yours to work Retriever II! _________________ "Pulling together is the aim of despotism and tyranny. Free men pull in all kinds of directions."
Terry Pratchett, The Truth |
|
Back to top |
|
|
GreyArea n00b
Joined: 29 Aug 2003 Posts: 17 Location: Munich, Germany
|
Posted: Mon Oct 06, 2003 11:09 am Post subject: Solved ?? |
|
|
I had the same problem - however this was solved by fixing a mistake in /etc/conf.d/apache2 from
Code: | APACHE2_OPTS="-D SSL PHP4" |
to
Code: | APACHE2_OPTS="-D SSL -D PHP4" |
Hope this Helps
GreyArea |
|
Back to top |
|
|
blight01 n00b
Joined: 26 Sep 2003 Posts: 24 Location: Belgium
|
Posted: Mon Dec 29, 2003 11:15 pm Post subject: |
|
|
M104 wrote: | What exactly does it say when it complains? You can try a
Code: | rc-update del apache2 default
rc-update add apache2 default |
and see if that clears up dependency issues. The only thing I can think of is that apache is requiring some service that hasn't loaded yet when the apache2 script is run during startup. |
Hi!
I had the same problem at boot Retriever II...Apache2 did not start at boot but when I was logged in, all seemed much better because I could start the apache2 script (in /etc/init.d/apache2)...
A tip for newbie (like me )...
In order to resolve this "small" problem, I deleted the apache2 script from the DEFAULT runlevel
#rc-update add apache2 default
and added it in another runlevel, which must be executed AFTER the services executed during the DEFAULT runlevel (I have always followed the Gentoo guides, so...In my case, no service has been added in the NONETWORK runlevel (i.e., /etc/runlevels/nonetwork) and I simply typed:)
#rc-update add apache2 nonetwork
in order to start apache2 at boot without any problem.
Hope it will help. |
|
Back to top |
|
|
blight01 n00b
Joined: 26 Sep 2003 Posts: 24 Location: Belgium
|
Posted: Mon Dec 29, 2003 11:20 pm Post subject: |
|
|
blight01 wrote: |
In order to resolve this "small" problem, I deleted the apache2 script from the DEFAULT runlevel
#rc-update add apache2 default
|
The command above is false of course but it must be rather...
#rc-update del apache2 default
Arrrgh! |
|
Back to top |
|
|
blight01 n00b
Joined: 26 Sep 2003 Posts: 24 Location: Belgium
|
Posted: Wed Dec 31, 2003 2:07 pm Post subject: To start properly apache2 at boot... |
|
|
Hello again...
First step:
If you already have an apache2 script added in some runlevel <runlevel>, you have to delete it from that runlevel <runlevel>:
#rc-update del apache2 <runlevel>
apache2 seems to depend of some services like we can see it in the
/etc/init.d/apache2 script:
#!/sbin/runscript
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /home/cvsroot/gentoo-x86/net-www/apache/files/2.0.40/apache2.initd,v$
opts="${opts} reload"
depend() {
need net
use mysql dns logger netmount
after sshd
}
(For an explanation of these dependency types such as "need" or "use", go to http://www.gentoo.org/doc/en/rc-scripts.xml)
In fact, apache2 seems to depend (NEED) of the "net" service and particularly of the internet interface...The problem is that "need net" in the apache2 script is not "sufficient" to ensure that all net services will be brought up before the execution of the apache2 script (go to http://www.gentoo.org/doc/en/rc-scripts.xml: "When multiple initscripts provide a certain virtual (for instance if you have multiple net.eth* scripts which all provide "net"), only a single one will be seen as a possible dependency. So if you need net, then the rc script will use one of the available net.eth* scripts, not all!)")...Thus, if you have more than 1 interface, the "need net" in apache2 script will not be "sufficient" and apache2 script can be launched once 1 of your interfaces has only been brought up...
To resolve this, you must add the "need" (or "use" ??) dependency type with the script(s) that initializes the other interfaces...In my case, I must add the speedtouch script as a need dependency of the apache2 script:
#!/sbin/runscript
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /home/cvsroot/gentoo-x86/net-www/apache/files/2.0.40/apache2.initd,v$
opts="${opts} reload"
depend() {
need net speedtouch
use mysql dns logger netmount
after sshd
}
...If you have an Alcatel speedtouch usb like me, take care of add the speedtouch script and not the net.ppp0 script in the apache2 script! Because the net.ppp0 script contains a setup_cfg_files() function that erases your ppp configuration files (in /etc/ppp/ directory) and if ever net.ppp0 is called, your connection to the internet with your Speedtouch will not probably work any more.
(To prevent that net.ppp0 automatically generates configuration files in /etc/ppp, I think you can add the line AUTOCFGFILES="no" in the /etc/conf.d/net.ppp0 file.)
Second step:
You can add now your apache2 script in the same runlevel (in the example below, it is the default runlevel) that your speedtouch or another net scripts by typing:
#rc-update add apache2 default
Hope this will help... |
|
Back to top |
|
|
|