Subject: pkg/19127: "apachectl restart" does not work properly for $apache_start=startssl
To: None <gnats-bugs@gnats.netbsd.org>
From: Greg A. Woods <woods@weird.com>
List: netbsd-bugs
Date: 11/21/2002 16:35:13
>Number:         19127
>Category:       pkg
>Synopsis:       "apachectl restart" does not work properly for $apache_start=startssl
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Nov 21 13:36:01 PST 2002
>Closed-Date:
>Last-Modified:
>Originator:     Greg A. Woods
>Release:        pkgsrc-current 2002/11/20
>Organization:
Planix, Inc.; Toronto, Ontario; Canada
>Environment:
System: NetBSD 1.5W
Architecture: i386
Machine: i386
>Description:

	"apachectl restart" does not work properly for $apache_start=startssl

	the apache RC.D script should also support the additional features
	of apachectl which are compatible with RC.D script usage.

>How-To-Repeat:

>Fix:

Index: www/apache/files/apache.sh
===================================================================
RCS file: /cvs/master/m-NetBSD/main/pkgsrc/www/apache/files/apache.sh,v
retrieving revision 1.24
diff -c -r1.24 apache.sh
*** www/apache/files/apache.sh	19 Nov 2002 23:08:47 -0000	1.24
--- www/apache/files/apache.sh	21 Nov 2002 05:46:53 -0000
***************
*** 1,4 ****
! #!@RCD_SCRIPTS_SHELL@
  #
  # $NetBSD: apache.sh,v 1.24 2002/11/19 23:08:47 jlam Exp $
  #
--- 1,4 ----
! #! @RCD_SCRIPTS_SHELL@
  #
  # $NetBSD: apache.sh,v 1.24 2002/11/19 23:08:47 jlam Exp $
  #
***************
*** 10,16 ****
  #
  # apache=YES 
  # apache_start="start"  # set to "startssl" to allow HTTPS connections
! #			# if ap-ssl is installed; this variable is optional
  
  if [ -f /etc/rc.subr ]
  then
--- 10,16 ----
  #
  # apache=YES 
  # apache_start="start"  # set to "startssl" to allow HTTPS connections
! #			# if ap-ssl is not installed; this variable is optional
  
  if [ -f /etc/rc.subr ]
  then
***************
*** 22,32 ****
  command="@PREFIX@/sbin/httpd"
  ctl_command="@PREFIX@/sbin/apachectl"
  required_files="@PKG_SYSCONFDIR@/httpd.conf"
! extra_commands="reload"
  start_cmd="apache_doit start"
  stop_cmd="apache_doit stop"
- restart_cmd="apache_doit restart"
  reload_cmd="apache_doit reload"
  
  apache_doit ()
  {
--- 22,37 ----
  command="@PREFIX@/sbin/httpd"
  ctl_command="@PREFIX@/sbin/apachectl"
  required_files="@PKG_SYSCONFDIR@/httpd.conf"
! extra_commands="reload status configtest"
! 
  start_cmd="apache_doit start"
  stop_cmd="apache_doit stop"
  reload_cmd="apache_doit reload"
+ status_cmd="apache_doit status"
+ configtest_cmd="apache_doit configtest"
+ 
+ restart_cmd="apache_restart"
+ 
  
  apache_doit ()
  {
***************
*** 38,43 ****
--- 43,60 ----
  	*)	action=$1 ;;
  	esac
  	${ctl_command} ${action}
+ }
+ 
+ apache_restart ()
+ {
+ 	: ${apache_start:=start}
+ 
+ 	if [ ${apache_start} == "start" ] ; then
+ 		apache_doit restart
+ 	else
+ 		apache_doit stop
+ 		apache_doit start
+ 	fi
  }
  
  if [ -f /etc/rc.subr -a -f /etc/rc.conf -a -d /etc/rc.d -a -f /etc/rc.d/DAEMON ]
>Release-Note:
>Audit-Trail:
>Unformatted: