diff -u apache2-2.2.8/debian/control apache2-2.2.8/debian/control --- apache2-2.2.8/debian/control +++ apache2-2.2.8/debian/control @@ -1,7 +1,8 @@ Source: apache2 Section: web Priority: optional -Maintainer: Debian Apache Maintainers +Maintainer: Ubuntu Core Developers +XSBC-Original-Maintainer: Debian Apache Maintainers Uploaders: Tollef Fog Heen , Thom May , Fabio M. Di Nitto , Adam Conrad , Peter Samuelson , Stefan Fritsch Build-Depends: debhelper (>=4.1.16), dpatch, lsb-release, libaprutil1-dev, libapr1-dev (>= 1.2.7-6), openssl, libpcre3-dev, libtool, mawk, zlib1g-dev, libssl-dev, sharutils Standards-Version: 3.7.3.0 diff -u apache2-2.2.8/debian/changelog apache2-2.2.8/debian/changelog --- apache2-2.2.8/debian/changelog +++ apache2-2.2.8/debian/changelog @@ -1,3 +1,13 @@ +apache2 (2.2.8-1ubuntu1) hardy; urgency=low + + * debian/apache2.2-common.apache2.init: + - LSB requires "status" section in init scripts, (LP: #201287) + - Fix spurious script exits (mentioned in the comment just above change) + - Fix echo's with LSB-preferred log_*_msg + - Fix exit code per LSB spec + + -- Dustin Kirkland Wed, 12 Mar 2008 12:24:42 -0500 + apache2 (2.2.8-1) unstable; urgency=low * New upstream version: diff -u apache2-2.2.8/debian/apache2.2-common.apache2.init apache2-2.2.8/debian/apache2.2-common.apache2.init --- apache2-2.2.8/debian/apache2.2-common.apache2.init +++ apache2-2.2.8/debian/apache2.2-common.apache2.init @@ -26,15 +26,16 @@ HTCACHECLEAN_OPTIONS="" set -e + +. /lib/lsb/init-functions + if [ -x /usr/sbin/apache2 ] ; then HAVE_APACHE2=1 else - echo "No apache MPM package installed" - exit 0 + log_failure_msg "No apache MPM package installed" + exit 6 fi -. /lib/lsb/init-functions - test -f /etc/default/rcS && . /etc/default/rcS test -f /etc/default/apache2 && . /etc/default/apache2 @@ -65,11 +66,12 @@ pidof_apache() { # if pidof is null for some reasons the script exits automagically # classified as good/unknown feature - PIDS=`pidof apache2` || true + # the "|| true" inside of the shell call seems to help + PIDS=`pidof apache2 || true` PFILE=`. /etc/apache2/envvars ; echo $APACHE_PID_FILE` if [ -z "$PFILE" ] ; then - echo ERROR: APACHE_PID_FILE needs to be defined in /etc/apache2/envvars >&2 + log_failure_msg "ERROR: APACHE_PID_FILE needs to be defined in /etc/apache2/envvars" exit 2 fi @@ -148,7 +150,7 @@ if ! $APACHE2CTL configtest > /dev/null 2>&1; then $APACHE2CTL configtest || true log_end_msg 1 - exit 1 + exit 6 fi log_daemon_msg "Reloading web server config" "apache2" if pidof_apache > /dev/null ; then @@ -191,7 +193,16 @@ log_end_msg 0 ;; + status) + if pidof_apache >/dev/null; then + log_success_msg "Apache is running." + exit 0 + else + log_failure_msg "Apache is not running." + exit 1 + fi + ;; *) - log_success_msg "Usage: /etc/init.d/apache2 {start|stop|restart|reload|force-reload|start-htcacheclean|stop-htcacheclean}" - exit 1 + log_success_msg "Usage: /etc/init.d/apache2 {start|stop|restart|reload|force-reload|start-htcacheclean|stop-htcacheclean|status}" + exit 3 ;; esac