Apache2 as daemon

Hi,

I’m working over an SSH connection on a server running suse 11.0. I’m using Apache 2.2.8 as a webserver, but sofar I haven’t been bothered about running it as a daemon because I haven’t had to reboot the server. Now it appears our IT people do that without asking, and so I have to make sure apache restarts automatically. The same goes for Tomcat 6 on the same machine.

I’ve tried to follow the book, and created links to the corresponding scripts in /etc/rc.d/rc3.d:
lrwxrwxrwx 1 root root 10 16. Mär 17:46 S80httpd → …/apache2
lrwxrwxrwx 1 root root 10 16. Mär 17:47 S85tomcat → …/tomcat6

lrwxrwxrwx 1 root root 10 15. Apr 13:34 K01tomcat → …/tomcat6
lrwxrwxrwx 1 root root 10 15. Apr 13:33 K02httpd → …/apache2

However, this doesn’t seem to be working, neither Apache nor Tomcat are started when the server reboots. Have I forgotten something??

thx for your help!

pagod

On SUSE you are not supposed to make the symlinks yourself but use chkconfig to activate the service:

chkconfig --set apache2 on
chkconfig --set tomcat6 on

Or do it from the runlevel editor in YaST.

pagod wrote:
> I’m working over an SSH connection on a server running suse 11.0. I’m
> using Apache 2.2.8 as a webserver, but sofar I haven’t been bothered
> about running it as a daemon because I haven’t had to reboot the server.
> Now it appears our IT people do that without asking, and so I have to
> make sure apache restarts automatically. The same goes for Tomcat 6 on
> the same machine.
>
> I’ve tried to follow the book, and created links to the corresponding
> scripts in /etc/rc.d/rc3.d:
> lrwxrwxrwx 1 root root 10 16. Mär 17:46 S80httpd → …/apache2
> lrwxrwxrwx 1 root root 10 16. Mär 17:47 S85tomcat → …/tomcat6
>
> lrwxrwxrwx 1 root root 10 15. Apr 13:34 K01tomcat → …/tomcat6
> lrwxrwxrwx 1 root root 10 15. Apr 13:33 K02httpd → …/apache2
>
> However, this doesn’t seem to be working, neither Apache nor Tomcat are
> started when the server reboots. Have I forgotten something??

chkconfig -a apache2 tomcat6
(or YaST runlevel editor)

just as mentioned in the Quickstart document.
http://en.opensuse.org/Apache_Quickstart_HOWTO#Starting_the_server

Kind regards,
Andreas Stieger

If the YaST2 module for apache is installed there is an option in there as well.

If you have installed java (sdk or jre) on the machine, check to see if the jexec service is running. This causes many services not to start at boot.

If it is running, I would stop it and remove it from the services that automatically start at boot.

hi

thx a lot for the answers – initializing the daemons with chkconfig worked fine :slight_smile:

still i don’t understand why it didn’t work when i did it myself :confused: should i have edited another file? or was it a problem with the names? i had named the link to apache2 S80httpd and chkconfig named it S12apache2, but surely that wouldn’t be the problem, would it? setting the index to 80 probably didn’t matter either, as it only meant apache was started at the end (before tomcat, which had index 85), but it should have had any interactions with other daemons that were running before anyway.

anyway, thx again for your help :slight_smile:

pagod

The init system on SUSE is a bit more elaborate than a script just running through the numbers in sequence. If you look at the hidden files in /etc/init.d, you will see some dependency graphs constructed by the init utilities. That’s why you have to go through the utilities. In return for that little bit of bureaucracy, you get the dependencies automatically determined from the metadata at the top of the init scripts, and not having to work out where in the sequence to insert your service.

ken yap schrieb:
> The init system on SUSE is a bit more elaborate than a script just
> running through the numbers in sequence. If you look at the hidden files
> in /etc/init.d, you will see some dependency graphs constructed by the
> init utilities. That’s why you have to go through the utilities. In
> return for that little bit of bureaucracy, you get the dependencies
> automatically determined from the metadata at the top of the init
> scripts, and not having to work out where in the sequence to insert your
> service.

If you absolutely need the old mechanism with the S<nn>/K<nn> symlinks,
you can reenable it by setting RUN_PARALLEL=“no” in /etc/sysconfig/boot.
But it’s better to work with the system than against it.

HTH
TS