ports/153264: www/apache22 and apache13-modssl -- rc.d script improvements
Jeremy Chadwick
freebsd at jdc.parodius.com
Sat Dec 18 09:10:11 UTC 2010
>Number: 153264
>Category: ports
>Synopsis: www/apache22 and apache13-modssl -- rc.d script improvements
>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: Sat Dec 18 09:10:10 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator: Jeremy Chadwick
>Release: FreeBSD 8.2-PRERELEASE amd64
>Organization:
>Environment:
System: FreeBSD icarus.home.lan 8.2-PRERELEASE FreeBSD 8.2-PRERELEASE #0: Sat Nov 27 12:54:04 PST 2010 root at icarus.home.lan:/usr/obj/usr/src/sys/X7SBA_RELENG_8_amd64 amd64
>Description:
The rc.d startup scripts for www/apache22 and www/apache13-modssl
contain a couple minor mistakes within the apache22_checkfib()
and apache_checkfib() functions respectively:
1) These functions call "sysctl" rather than /sbin/sysctl. Under
a shell with a decent $PATH this works fine, but under /bin/sh
spawned from cron sysctl isn't found ($PATH lacks /sbin there).
rc.subr(8) makes note of the SYSCTL variable which refers to
the full path of sysctl(8).
2) Call /usr/sbin/setfib, rather than just "setfib".
3) Fix some extraneous tabbing on a "return 0" statement.
>How-To-Repeat:
Make a cron job which does /usr/local/etc/rc.d/apache22 restart
and examine the output -- it will show "sysctl: command not found".
Alternatively, run /bin/sh then set PATH to /bin:/usr/bin.
>Fix:
Apply the below patches, respectively. I'll also follow up to
this PR with URLs to the patches.
diff -ruN apache22.orig/files/apache22.in apache22/files/apache22.in
--- apache22.orig/files/apache22.in 2010-10-22 07:07:31.000000000 -0700
+++ apache22/files/apache22.in 2010-12-18 00:41:35.000000000 -0800
@@ -174,14 +174,14 @@
}
apache22_checkfib () {
- sysctl net.fibs >/dev/null 2>&1
+ $SYSCTL net.fibs >/dev/null 2>&1
ret=$?
[ $ret -gt 0 ] && return 0
if [ "x$apache22_fib" != "xNO" ]
then
- command="setfib -F ${apache22_fib} ${command}"
+ command="/usr/sbin/setfib -F ${apache22_fib} ${command}"
else
- return 0
+ return 0
fi
}
diff -ruN apache13-modssl.orig/files/apache.in apache13-modssl/files/apache.in
--- apache13-modssl.orig/files/apache.in 2010-09-17 07:23:06.000000000 -0700
+++ apache13-modssl/files/apache.in 2010-12-18 00:38:39.000000000 -0800
@@ -169,14 +169,14 @@
}
apache_checkfib () {
- sysctl net.fibs >/dev/null 2>&1
+ $SYSCTL net.fibs >/dev/null 2>&1
ret=$?
[ $ret -gt 0 ] && return 0
if [ "x$apache_fib" != "xNO" ]
then
- command="setfib -F ${apache_fib} ${command}"
+ command="/usr/sbin/setfib -F ${apache_fib} ${command}"
else
- return 0
+ return 0
fi
}
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list