From: Greg Brockman Date: Fri, 22 Jan 2010 06:40:50 +0000 (-0500) Subject: Initial build of invirt-web-afs-apache. Package builds but has not been tested becau... X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-web-afs-apache.git/commitdiff_plain Initial build of invirt-web-afs-apache. Package builds but has not been tested because I am scared to install it. svn path=/trunk/packages/invirt-web-afs-apache/; revision=2914 --- d8571cc91cee20605842f105a54e68e15def1258 diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..2d7c490 --- /dev/null +++ b/debian/changelog @@ -0,0 +1,6 @@ +invirt-web-afs-apache (0.0.1) unstable; urgency=low + + * Initial release. + + -- Greg Brockman Fri, 22 Jan 2010 01:31:26 -0500 + diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..b8626c4 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +4 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..3ad02c5 --- /dev/null +++ b/debian/control @@ -0,0 +1,15 @@ +Source: invirt-web-afs-apache +Section: base +Priority: extra +Maintainer: Invirt project +Build-Depends: cdbs (>= 0.4.23-1.1), debhelper (>= 4.1.0), config-package-dev +Standards-Version: 3.7.2 + +Package: invirt-web-afs-apache +Architecture: all +Depends: ${misc:Depends}, apache2, + kstart, debathena-afs-config, openafs-modules-xen +Provides: ${diverted-files} +Conflicts: ${diverted-files} +Replaces: invirt-web-iptables (<= 0.0.2) +Description: the Invirt web interface diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..e37a78f --- /dev/null +++ b/debian/copyright @@ -0,0 +1,21 @@ +This software was written as part of the Invirt project . + +Copyright : + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + +On Debian systems, the complete text of the GNU General Public License +can be found in the file /usr/share/common-licenses/GPL. + +The file "code/static/power_installing.png" is from the Human-O2 icon +set by Oliver Scholtz and is released under the "GNU/GPL" (source: +http://www.iconfinder.net/icondetails/24350/128/ - +http://schollidesign.deviantart.com/art/Human-O2-Iconset-105344123) diff --git a/debian/invirt-web-afs-apache.install b/debian/invirt-web-afs-apache.install new file mode 100644 index 0000000..9da31b3 --- /dev/null +++ b/debian/invirt-web-afs-apache.install @@ -0,0 +1 @@ +files/* . diff --git a/debian/invirt-web-afs-apache.postinst b/debian/invirt-web-afs-apache.postinst new file mode 100755 index 0000000..5475d53 --- /dev/null +++ b/debian/invirt-web-afs-apache.postinst @@ -0,0 +1,44 @@ +#!/bin/sh +# postinst script for #PACKAGE# +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `configure' +# * `abort-upgrade' +# * `abort-remove' `in-favour' +# +# * `abort-remove' +# * `abort-deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + configure) + # Our init script proxies all requests to Apache's, so Apache's + # running is just a NOP + update-rc.d -f apache2 remove + ;; + + abort-upgrade|abort-remove|abort-deconfigure) + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + diff --git a/debian/invirt-web-afs-apache.prerm b/debian/invirt-web-afs-apache.prerm new file mode 100644 index 0000000..f38fe95 --- /dev/null +++ b/debian/invirt-web-afs-apache.prerm @@ -0,0 +1,41 @@ +#!/bin/sh +# prerm script for invirt-web +# +# see: dh_installdeb(1) + +set -e + +# summary of how this script can be called: +# * `remove' +# * `upgrade' +# * `failed-upgrade' +# * `remove' `in-favour' +# * `deconfigure' `in-favour' +# `removing' +# +# for details, see http://www.debian.org/doc/debian-policy/ or +# the debian-policy package + + +case "$1" in + remove|upgrade|deconfigure) + update-rc.d apache2 defaults 91 9 + ;; + + failed-upgrade) + ;; + + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +# dh_installdeb will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 + + diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..3fb0801 --- /dev/null +++ b/debian/rules @@ -0,0 +1,8 @@ +#!/usr/bin/make -f + +DEB_DIVERT_EXTENSION = .invirt +DEB_DIVERT_FILES_invirt-web-afs-apache += \ + /etc/init.d/apache2 + +include /usr/share/cdbs/1/rules/debhelper.mk +include /usr/share/cdbs/1/rules/config-package.mk diff --git a/files/etc/init.d/apache2.invirt b/files/etc/init.d/apache2.invirt new file mode 100755 index 0000000..3a4d69b --- /dev/null +++ b/files/etc/init.d/apache2.invirt @@ -0,0 +1,67 @@ +#!/usr/bin/pagsh -e +### BEGIN INIT INFO +# Provides: apache2 +# Required-Start: $local_fs $remote_fs $network $syslog openafs-client +# Required-Stop: $local_fs $remote_fs $network $syslog openafs-client +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Start/stop apache2 web server +### END INIT INFO +# +# Apache kstart wrapper by anders. +# + +SCRIPT=/etc/init.d/apache2.invirt-orig +KSTART_PIDFILE=/var/run/k5start-apache2.pid +KSTART_KEYTAB=/etc/invirt/keytab + +export AFSCELL=sipb.mit.edu + +kstart_start () { + TMP_PIDFILE=$(mktemp /tmp/k5start-apache2.pid-XXXXXX) + chown www-data "$TMP_PIDFILE" + export KRB5CCNAME=$(mktemp /tmp/krb5cc_33.kstart-XXXXXX) + chown www-data $KRB5CCNAME + /sbin/start-stop-daemon --start --pidfile "$TMP_PIDFILE" -c www-data \ + --exec /usr/bin/k5start -- -b -p "$TMP_PIDFILE" \ + -f "$KSTART_KEYTAB" -K10 -S afs -I "$AFSCELL" -t \ + "daemon/$(hostname -f)" + cat "$TMP_PIDFILE" >|"$KSTART_PIDFILE" + rm -f "$TMP_PIDFILE" +} +kstart_stop () { + if [ -e $KSTART_PIDFILE ]; then + /sbin/start-stop-daemon --stop --pidfile $KSTART_PIDFILE + pgrep apache2 >/dev/null && sleep 1 \ + && pgrep apache2 >/dev/null && sleep 1 \ + && pgrep apache2 >/dev/null && sleep 1 \ + && pgrep apache2 >/dev/null && sleep 1 \ + && pkill -9 apache2 + rm -f $KSTART_PIDFILE + else + echo -n " ... no kstart pidfile" + fi +} + +case "$1" in + start) + echo -n "Starting kstart for Apache2: k5start" + kstart_start + echo "." + exec "$SCRIPT" start + ;; + stop) + "$SCRIPT" stop + echo -n "Stopping kstart for Apache2: k5start" + kstart_stop + echo "." + ;; + restart|force-reload) + "$0" stop + sleep 1 + "$0" start + ;; + *) + exec "$SCRIPT" "$@" + ;; +esac