ports/88836: Update port: www/apache2 (fix harcoded pidfile in the rc script)
Denis Shaposhnikov
dsh at vlink.ru
Fri Nov 11 11:20:22 UTC 2005
>Number: 88836
>Category: ports
>Synopsis: Update port: www/apache2 (fix harcoded pidfile in the rc script)
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Fri Nov 11 11:20:15 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator: Denis Shaposhnikov
>Release: FreeBSD 7.0-CURRENT i386
>Organization:
>Environment:
System: FreeBSD neva.vlink.ru 7.0-CURRENT FreeBSD 7.0-CURRENT #0: Wed Oct 26 10:07:22 MSD 2005 dsh at neva.vlink.ru:/var/FreeBSD/obj/var/FreeBSD/src/sys/NEVA i386
>Description:
The pidfile in the rc script is hardcoded to "/var/run/httpd.pid". But
it possible to change PidFile directive in httpd.conf. I think it's
better not to hardcode it in the rc script.
>How-To-Repeat:
Change PidFile in httpd.conf to something else and try to
use /usr/local/etc/rc.d/apache2.sh
>Fix:
diff -Nru apache2.orig/files/apache.sh apache2/files/apache.sh
--- apache2.orig/files/apache.sh Fri Nov 11 13:59:06 2005
+++ apache2/files/apache.sh Fri Nov 11 14:03:01 2005
@@ -23,6 +23,9 @@
# Extra flags passed to start command.
# apache2limits_args (str): Default to "-e -C daemon"
# Arguments of pre-start limits run.
+# apache2_pidprefix (str): Default to "/var/run/httpd"
+# Path to apache's pidfile without .pid
+# suffix.
#
. %%RC_SUBR%%
@@ -34,8 +37,6 @@
restart_precmd="apache2_checkconfig"
reload_precmd="apache2_checkconfig"
command="%%PREFIX%%/sbin/httpd"
-_pidprefix="/var/run/httpd"
-pidfile="${_pidprefix}.pid"
required_files=%%PREFIX%%/etc/apache2/httpd.conf
[ -z "${apache2_enable}" ] && apache2_enable="NO"
@@ -46,6 +47,9 @@
[ -z "${apache2_configfile}" ] && apache2_configfile=""
load_rc_config $name
+
+_pidprefix=${apache2_pidprefix:-"/var/run/httpd"}
+pidfile="${_pidprefix}.pid"
if [ -n "${2}" ]; then
profile=${2}
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list