Apache2 boot script on openSUSE 10.3

I am having a problem with Apache2 on openSUSE 10.3.

#/sbin/chkconfig --list apache2
apache2 0:off 1:off 2:off 3:on 4:off 5:on 6:off

#ll /etc/init.d/rc3.d/apache /etc/init.d/rc5.d/apache
/etc/init.d/rc3.d/K04apache2 → …/apache2
/etc/init.d/rc3.d/S18apache2 → …/apache2
/etc/init.d/rc5.d/K04apache2 → …/apache2
/etc/init.d/rc5.d/S18apache2 → …/apache2

After the system is booted, apache2 can be started by

/etc/init.d/apache2 start

It can also be started with YaST2 -> System -> System Services(Runlevel). Select apache2 and enable it.

But, when the system is rebooted, apache2 can not be started automatically. I have to start it manually with one of the above methods.

Any idea why apache2 does not start at boot time?

Thank you.

Possibly because the sequencing is wrong? Are you using the standard supplied init script or one that you wrote?

If using the standard one, you can fix up the sequencing with:

SuSEconfig

BTW, this will remove any “rogue” symlinks. Only the SuSEconfig system can make permanent symlinks, based on the dependencies stated in the metadata in the header of every valid init script.

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

What do the Apache log files (/var/log/apache2/error_log, etc.) state?

Good luck.

quantumncyu wrote:
> I am having a problem with Apache2 on openSUSE 10.3.
>
> #/sbin/chkconfig --list apache2
> apache2 0:off 1:off 2:off 3:on 4:off 5:on 6:off
>
> #ll /etc/init.d/rc3.d/apache /etc/init.d/rc5.d/apache
> /etc/init.d/rc3.d/K04apache2 → …/apache2
> /etc/init.d/rc3.d/S18apache2 → …/apache2
> /etc/init.d/rc5.d/K04apache2 → …/apache2
> /etc/init.d/rc5.d/S18apache2 → …/apache2
>
> After the system is booted, apache2 can be started by
>
> /etc/init.d/apache2 start
>
> It can also be started with YaST2 → System → System
> Services(Runlevel). Select apache2 and enable it.
>
> But, when the system is rebooted, apache2 can not be started
> automatically. I have to start it manually with one of the above
> methods.
>
> Any idea why apache2 does not start at boot time?
>
> Thank you.
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFJGZEh3s42bA80+9kRAg5gAKCDad78YQkKhQUo7Mp5K6OV+IK91ACeMAwO
V/Czt1xWtw3KKPJwVxJCEWk=
=LuZn
-----END PGP SIGNATURE-----

To: ken_yap

I am using the /etc/init.d/apache2 init file that comes with openSUSE 10.3. I make no change to it.

SuSEconfig does not help. After running SuSEconfig,

#/sbin/chkconfig --list apache2

and

#ll /etc/init.d/rc3.d/apache /etc/init.d/rc5.d/apache

still give the same results as before, and rebooting the system does not bring up apache2 automatically.


To ab@novell.com:

The last few lines of /var/log/apache2/error_log are

1.2.5 configured – resuming normal operations
[Tue Nov 11 19:35:10 2008] [notice] caught SIGTERM, shutting down
[Tue Nov 11 19:35:10 2008] [warn] (22)Invalid argument: Failed to destroy the ‘/tmp/mod_mono_dashboa
rd_XXGLOBAL_1’ shared memory dashboard
[Wed Nov 12 15:59:28 2008] [notice] Apache/2.2.4 (Linux/SUSE) PHP/5.2.6 with Suhosin-Patch mod_mono/
1.2.5 configured – resuming normal operations
[Wed Nov 12 16:21:57 2008] [notice] caught SIGTERM, shutting down
[Wed Nov 12 16:21:57 2008] [warn] (22)Invalid argument: Failed to destroy the ‘/tmp/mod_mono_dashboa
rd_XXGLOBAL_1’ shared memory dashboard


I did a further test on this problem.

I change the first line of /etc/init.d/apache2

#!/bin/sh

to be

#!/bin/sh -x

Then, manually do

/etc/init.d/apache2 start

The last few lines of output are

  • _rc_status=0
  • return 0
  • rc_exit
  • exit 0

But if I reboot, the last few lines of the output look different. At boot time, the boot text scrolls very fast on a text mode monitor, I can not keep track of the contents. Can anyone show me how to collect the output text? I guess viewing the text will give some insight into this problem.

Thank you.

It should be saved in /var/log/boot.msg

I check /var/log/boot.msg, and find that the output from /etc/init.d/apache comes BEFORE the following text,

Setting up network interfaces:
lo
lo IP address: 127.0.0.1/8

Hence, I do the following

su -
/sbin/chkconfig --del apache2
cd /etc/init.d/rc5.d
ln -s …/apache2 S20apache2

To check the change, I do

/sbin/chkconfig --list apache2
apache2 0:off 1:off 2:off 3:off 4:off 5:on 6:off

ll /etc/init.d/rc5.d/apache
/etc/init.d/rc5.d/S20apache2 → …/apache2*

Everything looks fine. Then reboot the system,

ps aux | grep apache2

root 3657 0.0 0.5 357848 12348 ? Ss 18:49 0:00 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
wwwrun 3689 0.0 0.3 357848 6524 ? S 18:49 0:00 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
wwwrun 3690 0.0 0.3 357848 6524 ? S 18:49 0:00 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
wwwrun 3691 0.0 0.3 357848 6520 ? S 18:49 0:00 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
wwwrun 3696 0.0 0.3 357848 6520 ? S 18:49 0:00 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf
wwwrun 3697 0.0 0.3 357848 6520 ? S 18:49 0:00 /usr/sbin/httpd2-prefork -f /etc/apache2/httpd.conf

Yes, apaches is there.

Is this a bug of openSUSE 10.3?

I am not an expert on computers. Just wondering about a question. When I do

/sbin/chkconfig --add appache2

the system generates the links

/etc/init.d/rc3.d/K04apache2 → …/apache2
/etc/init.d/rc3.d/S18apache2 → …/apache2
/etc/init.d/rc5.d/K04apache2 → …/apache2
/etc/init.d/rc5.d/S18apache2 → …/apache2

I believe the line

Default-Start: 3 5

in /etc/init.d/apache2 determines the directories rc3.d and rc5.d. But, how the system decides the prefix to be K04 and S18?

Thank you very much for your help on this problem.

SuSEconfig sequences the scripts based on the dependencies declared at the top of the init script. Apache’s init script should follow $local_fs $remote_fs $network according to the script. Perhaps $network is missing? Or the network init script is faulty and doesn’t provide “network”?

Thank you for responding.

Two questions:

  1. Which file contains the information on the dependencies declared at the top of the init script?

  2. What are $local_fs $remote_fs $network? How to know their values? How to know if $network is missing?

There is no central registry, the init scripts between themselves specify what they require and what they provide. In total, they form a digraph of dependencies. $network is provided by the script that has Provides: network in its header, and so forth.

However you can look at /etc/init.d/skeleton for some informative comments.

Hi
Have a look at the man page for insserv and the /etc/insserv.conf file
for explanations of those variables :slight_smile:


Cheers Malcolm °¿° (Linux Counter #276890)
openSUSE 11.0 x86 Kernel 2.6.25.18-0.2-default
up 2 days 9:56, 2 users, load average: 0.11, 0.06, 0.05
GPU GeForce 6600 TE/6200 TE - Driver Version: 177.80