Apache predefined script in redhat-cluster-suite is not properly setup for Ubuntu

Bug #250847 reported by Shang Wu
8
Affects Status Importance Assigned to Milestone
redhat-cluster-suite (Ubuntu)
Invalid
Medium
Ante Karamatić

Bug Description

Background:
I tried to setup the apache server using redhat-cluster-suite on three machines running Hardy. The apache server can be started on any single machine without any error, but not using the redhat-cluster-suite to start the apache service.

Symptom:
Once the apache service started from the redhat-cluster-suite, it will stated as start for 5 seconds and tried to restart again.

The log message (/var/log/syslog) looks like the following:
Jul 22 10:26:20 c3 clurgmgrd[6529]: <notice> Service service:Apache2 started
Jul 22 10:26:24 c3 clurgmgrd: [6529]: <err> script:Web Services: status of /etc/init.d/apache2 failed (returned 1)
Jul 22 10:26:24 c3 clurgmgrd[6529]: <notice> status on script "Web Services" returned 1 (generic error)
Jul 22 10:26:24 c3 clurgmgrd[6529]: <notice> Stopping service service:Apache2
Jul 22 10:26:24 c3 clurgmgrd[6529]: <notice> Service service:Apache2 is recovering
Jul 22 10:26:24 c3 clurgmgrd[6529]: <notice> Recovering failed service service:Apache2
Jul 22 10:26:24 c3 clurgmgrd[6529]: <notice> Service service:Apache2 started

What I have tried:
I looked at the /usr/share/cluster/apache.sh file and found 1 obvious error at line 43 where it says:
declare APACHE_genConfig="$APACHE_conf_dir/httpd.conf"
In Ubuntu, that file (httpd.conf) is empty. I changed that to apache2.conf, but still have the same issue.

Also, in the same file at line 142 where it says:
 for i in `"$APACHE_parseConfig" -D"$OCF_RESKEY_name" < "$originalConfigFile" | grep -E '(^Listen)|(^Port)' | grep -v ':'`; do
This refer to another file which will need some fixes too.

Hope this helps,

Revision history for this message
Shang Wu (shangwu) wrote :
Revision history for this message
Shang Wu (shangwu) wrote :
Revision history for this message
Shang Wu (shangwu) wrote :
Ante Karamatić (ivoks)
Changed in redhat-cluster-suite:
importance: Undecided → Medium
status: New → Confirmed
assignee: nobody → ivoks
Revision history for this message
Ante Karamatić (ivoks) wrote :

The thing is that there is no 'status' function in Ubuntu's apache init script. Simply (and falsely) adding this to /etc/init.d/apache2:

        status)
                log_success_msg "Running"
                log_end_msg 0
        ;;

would solve the issue. Of course, that's only proof of concept, not a bug fix.

This problem (non-existing status function in init scripts) is tackled by server team and community for intrepid. More info:

https://wiki.ubuntu.com/InitScriptStatusActions

Revision history for this message
Ante Karamatić (ivoks) wrote :

Real fix would be adding:

       status)
                PID=$(pidof_apache)
                if [ -n "$PID" ]; then
                        log_success_msg "Apache is running (pid $PID)."
                        exit 0
                else
                        log_failure_msg "Apache is not running."
                        exit 1
                fi
        ;;

to /etc/init.d/apache2 before *).

This of course, doesn't mean that there's no bug in configuration parser in rgmanager.

Revision history for this message
Shang Wu (shangwu) wrote :

Thanks Ante!

This fixes the issue.

Revision history for this message
Steve Langasek (vorlon) wrote :

It's my understanding that this is resolved in intrepid and above, where the apache2 init script does provide a 'status' action. Marking this bug as invalid for rhcs, since no changes were required to that package.

Changed in redhat-cluster-suite:
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.