chiark / gitweb /
add apache-restart script
authorMartin Zobel-Helas <zobel@lunar>
Sun, 7 Dec 2008 14:50:19 +0000 (15:50 +0100)
committerMartin Zobel-Helas <zobel@lunar>
Sun, 7 Dec 2008 14:50:19 +0000 (15:50 +0100)
debian/changelog
debian/control
debian/copyright
debian/rules
restart-apache [new file with mode: 0644]

index 442108a..6c5329d 100644 (file)
@@ -1,3 +1,9 @@
+debian.org (8) stable; urgency=low
+
+  * Install restart-apache script.
+
+ -- Martin Zobel-Helas <zobel@debian.org>  Sun, 07 Dec 2008 15:35:45 +0100
+
 debian.org (7) stable; urgency=low
 
   * Depend on libpam-pwdfile.
index ec32a12..552091f 100644 (file)
@@ -2,7 +2,7 @@ Source: debian.org
 Section: local/admin
 Priority: required
 Maintainer: Debian sysadmin Team <debian-admin@debian.org>
-Uploaders: Ryan Murray <rmurray@debian.org>, Peter Palfrader <weasel@debian.org>
+Uploaders: Ryan Murray <rmurray@debian.org>, Peter Palfrader <weasel@debian.org>, Martin Zobel-Helas <zobel@debian.org>
 Standards-Version: 3.7.2
 
 Package: debian.org
index c396866..284cb76 100644 (file)
@@ -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
index 2226436..ca8b11f 100755 (executable)
@@ -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 (file)
index 0000000..6b7c405
--- /dev/null
@@ -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
+