summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2011-04-15 18:32:57 +0200
committerAlexander Sulfrian <alexander@sulfrian.net>2011-04-15 18:46:37 +0200
commit14eae05c4d91afab0bd404c781b8cd648b27bc4e (patch)
tree5526466e6afe3260fe5f718f2b9f4f484652a243
downloadautopatch-util-vserver-14eae05c4d91afab0bd404c781b8cd648b27bc4e.tar.gz
autopatch-util-vserver-14eae05c4d91afab0bd404c781b8cd648b27bc4e.tar.bz2
autopatch-util-vserver-14eae05c4d91afab0bd404c781b8cd648b27bc4e.zip
initial commit
-rw-r--r--debian/changelog5
-rw-r--r--debian/compat1
-rw-r--r--debian/control16
-rw-r--r--debian/copyright2
-rw-r--r--debian/install1
-rw-r--r--debian/postinst31
-rw-r--r--debian/prerm36
-rwxr-xr-xdebian/rules13
-rw-r--r--debian/source/format1
-rw-r--r--debian/triggers1
-rw-r--r--vserver-teardown.patch33
11 files changed, 140 insertions, 0 deletions
diff --git a/debian/changelog b/debian/changelog
new file mode 100644
index 0000000..98d5c6e
--- /dev/null
+++ b/debian/changelog
@@ -0,0 +1,5 @@
+autopatch-util-vserver (0.1-1) unstable; urgency=low
+
+ * Initial release
+
+ -- Alexander Sulfrian <alexander@sulfrian.net> Fri, 15 Apr 2011 17:54:06 +0200
diff --git a/debian/compat b/debian/compat
new file mode 100644
index 0000000..7f8f011
--- /dev/null
+++ b/debian/compat
@@ -0,0 +1 @@
+7
diff --git a/debian/control b/debian/control
new file mode 100644
index 0000000..4314f8a
--- /dev/null
+++ b/debian/control
@@ -0,0 +1,16 @@
+Source: autopatch-util-vserver
+Section: unknown
+Priority: extra
+Maintainer: Alexander Sulfrian <alexander@sulfrian.net>
+Build-Depends: debhelper (>= 7.0.50~)
+Standards-Version: 3.8.4
+Homepage: http://git.animux.de/autopatch-util-vserver.git
+Vcs-Git: git://git.animux.de/autopatch-util-vserver.git
+Vcs-Browser: http://git.animux.de/autopatch-util-vserver.git
+
+Package: autopatch-util-vserver
+Architecture: any
+Depends: util-vserver
+Description: This package is a personal patch for util-vserver to add
+ a teardown script, executed after the destruction of the
+ vserver namespace.
diff --git a/debian/copyright b/debian/copyright
new file mode 100644
index 0000000..b13917c
--- /dev/null
+++ b/debian/copyright
@@ -0,0 +1,2 @@
+Copyright: 2011 Alexander Sulfrian <alexander@sulfrian.net>
+License: as-is
diff --git a/debian/install b/debian/install
new file mode 100644
index 0000000..9f0d6f5
--- /dev/null
+++ b/debian/install
@@ -0,0 +1 @@
+vserver-teardown.patch /usr/share/autopatch-util-vserver/
diff --git a/debian/postinst b/debian/postinst
new file mode 100644
index 0000000..bfc92e3
--- /dev/null
+++ b/debian/postinst
@@ -0,0 +1,31 @@
+#!/bin/sh
+# postinst script for autopatch-util-vserver
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+# * <postinst> `configure' <most-recently-configured-version>
+# * <old-postinst> `abort-upgrade' <new version>
+# * <conflictor's-postinst> `abort-remove' `in-favour' <package>
+# <new-version>
+# * <postinst> `abort-remove'
+# * <deconfigured's-postinst> `abort-deconfigure' `in-favour'
+# <failed-install-package> <version> `removing'
+# <conflicting-package> <version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+test "$1" == "configure" -o "$1" == "triggered" && {
+ mkdir -p /var/lib/autopatch-util-vserver/backup/
+ cp -a /usr/sbin/vserver /var/lib/autopatch-util-vserver/backup/vserver
+ patch -f -p 0 < /usr/share/autopatch-util-vserver/vserver-teardown.patch
+}
+
+# dh_installdeb will replace this with shell code automatically
+# generated by other debhelper scripts.
+
+#DEBHELPER#
+
+exit 0
diff --git a/debian/prerm b/debian/prerm
new file mode 100644
index 0000000..7b190c6
--- /dev/null
+++ b/debian/prerm
@@ -0,0 +1,36 @@
+#!/bin/sh
+# prerm script for autopatch-util-vserver
+#
+# see: dh_installdeb(1)
+
+set -e
+
+# summary of how this script can be called:
+# * <prerm> `remove'
+# * <old-prerm> `upgrade' <new-version>
+# * <new-prerm> `failed-upgrade' <old-version>
+# * <conflictor's-prerm> `remove' `in-favour' <package> <new-version>
+# * <deconfigured's-prerm> `deconfigure' `in-favour'
+# <package-being-installed> <version> `removing'
+# <conflicting-package> <version>
+# for details, see http://www.debian.org/doc/debian-policy/ or
+# the debian-policy package
+
+case "$1" in
+ remove|upgrade|deconfigure|failed-upgrade)
+ test -r /var/lib/autopatch-util-vserver/backup/vserver && \
+ mv /var/lib/autopatch-util-vserver/backup/vserver /usr/sbin/vserver
+ ;;
+
+ *)
+ 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..b760bee
--- /dev/null
+++ b/debian/rules
@@ -0,0 +1,13 @@
+#!/usr/bin/make -f
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper.
+# This file was originally written by Joey Hess and Craig Small.
+# As a special exception, when this file is copied by dh-make into a
+# dh-make output file, you may use that output file without restriction.
+# This special exception was added by Craig Small in version 0.37 of dh-make.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+%:
+ dh $@
diff --git a/debian/source/format b/debian/source/format
new file mode 100644
index 0000000..89ae9db
--- /dev/null
+++ b/debian/source/format
@@ -0,0 +1 @@
+3.0 (native)
diff --git a/debian/triggers b/debian/triggers
new file mode 100644
index 0000000..5147346
--- /dev/null
+++ b/debian/triggers
@@ -0,0 +1 @@
+interest /usr/sbin/vserver
diff --git a/vserver-teardown.patch b/vserver-teardown.patch
new file mode 100644
index 0000000..a9ca0d9
--- /dev/null
+++ b/vserver-teardown.patch
@@ -0,0 +1,33 @@
+--- /usr/sbin/vserver 2011-04-07 16:39:34.000000000 +0200
++++ /usr/sbin/vserver 2011-04-07 19:50:45.000000000 +0200
+@@ -203,16 +203,27 @@
+ test "$cmd" != start -o -n "$OPTION_NONAMESPACE" || isAvoidNamespace "$VSERVER_DIR" || \
+ exec $_VNAMESPACE --new -- $_VSERVER ----nonamespace "${OPTIONS_ORIG[@]}"
+
++. $__PKGLIBDIR/vserver.functions
++
+ # Enter the namespace early so we can test for files inside the guest
+ test "$cmd" != enter -a "$cmd" != stop || \
+ test -n "$OPTION_NONAMESPACE" || isAvoidNamespace "$VSERVER_DIR" || \
+- ! isVserverRunning "$VSERVER_DIR" || \
+- exec $_VNAMESPACE --enter "$VSERVER_DIR" -- $_VSERVER ----nonamespace "${OPTIONS_ORIG[@]}"
++ ! isVserverRunning "$VSERVER_DIR" || {
++ $_VNAMESPACE --enter "$VSERVER_DIR" -- $_VSERVER ----nonamespace "${OPTIONS_ORIG[@]}"
++ result=$?
++
++ if test "$cmd" == "stop" ; then
++ pushd "$VSERVER_DIR" > /dev/null
++ execScriptlets "$VSERVER_DIR" "$VSERVER_NAME" teardown
++ popd > /dev/null
++ fi
++
++ exit $result
++ }
+
+ set_init_cwd
+ cd /
+
+-. $__PKGLIBDIR/vserver.functions
+ case "$2" in
+ (start|stop|delete)
+ shift 2