From: Martin Zobel-Helas Date: Sun, 7 Dec 2008 14:50:19 +0000 (+0100) Subject: add apache-restart script X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dsa-metapackages.git;a=commitdiff_plain;h=87dce8517553b2e9bff103e267ce03fe9dc8e2f1 add apache-restart script --- diff --git a/debian/changelog b/debian/changelog index 442108a..6c5329d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +debian.org (8) stable; urgency=low + + * Install restart-apache script. + + -- Martin Zobel-Helas Sun, 07 Dec 2008 15:35:45 +0100 + debian.org (7) stable; urgency=low * Depend on libpam-pwdfile. diff --git a/debian/control b/debian/control index ec32a12..552091f 100644 --- a/debian/control +++ b/debian/control @@ -2,7 +2,7 @@ Source: debian.org Section: local/admin Priority: required Maintainer: Debian sysadmin Team -Uploaders: Ryan Murray , Peter Palfrader +Uploaders: Ryan Murray , Peter Palfrader , Martin Zobel-Helas Standards-Version: 3.7.2 Package: debian.org diff --git a/debian/copyright b/debian/copyright index c396866..284cb76 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1,5 +1,7 @@ This is a metapackage for DSA maintained debian.org hosts. Copyright (c) 2007, Ryan Murray + (c) 2008, Peter Palfrader + (c) 2008, Martin Zobel-Helas License: GPL; see /usr/share/common-licenses/GPL diff --git a/debian/rules b/debian/rules index 2226436..ca8b11f 100755 --- a/debian/rules +++ b/debian/rules @@ -14,6 +14,7 @@ binary-indep: chown -R root.root debian/tmp chmod -R g-ws debian/tmp install -m755 upgrade-porter-chroots debian/tmp/usr/sbin + install -m755 restart-apache debian/tmp/usr/sbin install -m644 debian/copyright debian/tmp/usr/share/doc/debian.org/ install -m644 debian/changelog debian/tmp/usr/share/doc/debian.org/changelog gzip -9f debian/tmp/usr/share/doc/debian.org/changelog diff --git a/restart-apache b/restart-apache new file mode 100644 index 0000000..6b7c405 --- /dev/null +++ b/restart-apache @@ -0,0 +1,32 @@ +#!/bin/bash + +# needs: +# %apachectrl ALL=(root) /usr/sbin/restart-apache + +case $1 in + restart) + action="restart" + ;; + reload) + action="reload" + ;; + *) + echo "Usage: $0 [restart|reload]" + ;; +esac + +if [ -x /usr/sbin/apache2ctl ]; then + + /usr/sbin/apache2ctl configtest + + if [ "$?" != "0" ]; then + env -i /etc/init.d/apache2 $action + else + echo "configtest returned errors, thus not restarting apache" + exit 1 + fi +else + echo "Ehhh, there is no Apache2 on this machine" + exit 2 +fi +