httpd-2.4.1-apctl.patch 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. - fail gracefully if links is not installed on target system
  2. - source sysconfig/httpd for custom env. vars etc.
  3. - make httpd -t work even in SELinux
  4. - pass $OPTIONS to all $HTTPD invocation
  5. Upstream-HEAD: vendor
  6. Upstream-2.0: vendor
  7. Upstream-Status: Vendor-specific changes for better initscript integration
  8. --- httpd-2.4.1/support/apachectl.in.apctl
  9. +++ httpd-2.4.1/support/apachectl.in
  10. @@ -44,19 +44,25 @@
  11. # the path to your httpd binary, including options if necessary
  12. HTTPD='@exp_sbindir@/@progname@'
  13. #
  14. -# pick up any necessary environment variables
  15. -if test -f @exp_sbindir@/envvars; then
  16. - . @exp_sbindir@/envvars
  17. -fi
  18. #
  19. # a command that outputs a formatted text version of the HTML at the
  20. # url given on the command line. Designed for lynx, however other
  21. # programs may work.
  22. -LYNX="@LYNX_PATH@ -dump"
  23. +if [ -x "@LYNX_PATH@" ]; then
  24. + LYNX="@LYNX_PATH@ -dump"
  25. +else
  26. + LYNX=none
  27. +fi
  28. #
  29. # the URL to your server's mod_status status page. If you do not
  30. # have one, then status and fullstatus will not work.
  31. STATUSURL="http://localhost:@PORT@/server-status"
  32. +
  33. +# Source /etc/conf.d/apache2 for $HTTPD setting, etc.
  34. +if [ -r /etc/conf.d/apache2 ]; then
  35. + . /etc/conf.d/apache2
  36. +fi
  37. +
  38. #
  39. # Set this variable to a command that increases the maximum
  40. # number of file descriptors allowed per child process. This is
  41. @@ -76,9 +82,16 @@
  42. ARGV="-h"
  43. fi
  44. +function checklynx() {
  45. +if [ "$LYNX" = "none" ]; then
  46. + echo "The 'links' package is required for this functionality."
  47. + exit 8
  48. +fi
  49. +}
  50. +
  51. case $ACMD in
  52. start|stop|restart|graceful|graceful-stop)
  53. - $HTTPD -k $ARGV
  54. + $HTTPD $OPTIONS -k $ARGV
  55. ERROR=$?
  56. ;;
  57. startssl|sslstart|start-SSL)
  58. @@ -88,17 +101,18 @@
  59. ERROR=2
  60. ;;
  61. configtest)
  62. - $HTTPD -t
  63. - ERROR=$?
  64. + testconfig
  65. ;;
  66. status)
  67. + checklynx
  68. $LYNX $STATUSURL | awk ' /process$/ { print; exit } { print } '
  69. ;;
  70. fullstatus)
  71. + checklynx
  72. $LYNX $STATUSURL
  73. ;;
  74. *)
  75. - $HTTPD "$@"
  76. + $HTTPD $OPTIONS "$@"
  77. ERROR=$?
  78. esac