[26488] in Source-Commits

home help back first fref pref prev next nref lref last post

/svn/athena r25589 - trunk/debathena/config/reactivate/debian

daemon@ATHENA.MIT.EDU (Jonathan D Reed)
Fri Jun 29 12:50:50 2012

Date: Fri, 29 Jun 2012 12:50:48 -0400
From: Jonathan D Reed <jdreed@MIT.EDU>
Message-Id: <201206291650.q5TGomKl027867@drugstore.mit.edu>
To: source-commits@MIT.EDU
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Author: jdreed
Date: 2012-06-29 12:50:48 -0400 (Fri, 29 Jun 2012)
New Revision: 25589

Added:
   trunk/debathena/config/reactivate/debian/16killprocs-no-really
Modified:
   trunk/debathena/config/reactivate/debian/changelog
   trunk/debathena/config/reactivate/debian/copyright
   trunk/debathena/config/reactivate/debian/debathena-reactivate.install
Log:
In reactivate:
  * Update debian/copyright for 3-clause BSD and one GPL'd file
  * Ship 16killprocs-no-really to end sessions faster (Trac: #775)


Added: trunk/debathena/config/reactivate/debian/16killprocs-no-really
===================================================================
--- trunk/debathena/config/reactivate/debian/16killprocs-no-really	                        (rev 0)
+++ trunk/debathena/config/reactivate/debian/16killprocs-no-really	2012-06-29 16:50:48 UTC (rev 25589)
@@ -0,0 +1,102 @@
+#!/bin/sh
+#
+# A slightly faster way of ending processes in a chroot.
+# Copyright (c) 2012 Massachusetts Institute of Technology
+#
+# This is a derivative work of, and licensed under the same terms as,
+# 15killprocs from the schroot (1.4.17-1) package, whose license
+# information appears below:
+#
+# Copyright © 2007       Kees Cook <kees@outflux.net>
+# Copyright © 2007-2009  Roger Leigh <rleigh@debian.org>
+#
+# schroot 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 3 of the License, or
+# (at your option) any later version.
+#
+# schroot 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.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see
+# <http://www.gnu.org/licenses/>.
+#
+#####################################################################
+
+set -e
+
+. "$SETUP_DATA_DIR/common-data"
+. "$SETUP_DATA_DIR/common-functions"
+
+if [ -f "$CHROOT_SCRIPT_CONFIG" ]; then
+    . "$CHROOT_SCRIPT_CONFIG"
+elif [ "$STATUS" = "ok" ]; then
+    fatal "script-config file '$CHROOT_SCRIPT_CONFIG' does not exist"
+fi
+
+# Wrapper around kill command. Turns errors into
+# warnings when running in verbose mode, otherwise
+# it ignores them.
+# args: parameters for kill
+kill_proc()
+{
+    if ! kill "$@" 2>/dev/null; then
+        info "kill $@ failed: process already terminated?"
+    fi
+}
+
+# Kill all processes that were run from within the chroot environment
+# $1: mount base location
+do_kill_all()
+{
+    if [ -z "$1" ]; then
+	fatal "No path for finding stray processes: not reaping processes in chroot"
+    fi
+
+    info "Killing processes run inside $1"
+    # Don't use a pipe into a read loop, just use a normal for loop
+    pids=
+    for pid in $(ls /proc | egrep '^[[:digit:]]+$'); do
+	# Check if process root are the same device/inode as chroot
+	# root (for efficiency)
+        if [ /proc/"$pid"/root -ef "$1" ]; then
+	    # Check if process and chroot root are the same (may be
+	    # different even if device/inode match).
+	    root=$(readlink /proc/"$pid"/root || true)
+	    if [ "$root" = "$1" ]; then
+		exe=$(readlink /proc/"$pid"/exe || true)
+		info "Killing left-over pid $pid (${exe##$1})"
+		info "  Sending SIGTERM to pid $pid"
+
+		kill_proc -TERM "$pid"
+		# Save the pid
+		pids="$pids $pid"
+	    fi
+	fi
+    done
+    # Wait one second, as most things will respond to TERM gracefully
+    sleep 1
+    for pid in $pids; do
+	count=0
+	max=5
+	while [ -d /proc/"$pid" ]; do
+            count=$(( $count + 1 ))
+            info "  Waiting for pid $pid to shut down... ($count/$max)"
+            sleep 1
+            # Wait for $max seconds for process to die before -9'ing it
+            if [ "$count" -eq "$max" ]; then
+		info "  Sending SIGKILL to pid $pid"
+		kill_proc -KILL "$pid"
+		sleep 1
+		break
+            fi
+	done
+    done
+}
+
+if [ $STAGE = "setup-recover" ] || [ $STAGE = "setup-stop" ]; then
+    do_kill_all "$CHROOT_MOUNT_LOCATION"
+fi


Property changes on: trunk/debathena/config/reactivate/debian/16killprocs-no-really
___________________________________________________________________
Added: svn:executable
   + *

Modified: trunk/debathena/config/reactivate/debian/changelog
===================================================================
--- trunk/debathena/config/reactivate/debian/changelog	2012-06-28 22:59:17 UTC (rev 25588)
+++ trunk/debathena/config/reactivate/debian/changelog	2012-06-29 16:50:48 UTC (rev 25589)
@@ -1,3 +1,10 @@
+debathena-reactivate (2.0.35) unstable; urgency=low
+
+  * Update debian/copyright for 3-clause BSD and one GPL'd file
+  * Ship 16killprocs-no-really to end sessions faster (Trac: #775)
+
+ -- Jonathan Reed <jdreed@mit.edu>  Fri, 29 Jun 2012 12:48:18 -0400
+
 debathena-reactivate (2.0.34) unstable; urgency=low
 
   * dbus-daemon-launch-helper moved in precise

Modified: trunk/debathena/config/reactivate/debian/copyright
===================================================================
--- trunk/debathena/config/reactivate/debian/copyright	2012-06-28 22:59:17 UTC (rev 25588)
+++ trunk/debathena/config/reactivate/debian/copyright	2012-06-29 16:50:48 UTC (rev 25589)
@@ -1,18 +1,36 @@
-The Athena source code was obtained from the Athena SVN repository at
-<svn://debathena.mit.edu/athena/trunk>, and is licensed as follows:
+This package and its Debian packaging are licensed as follows, with
+the one caveat noted below.
 
-  Copyright © 2008 by the Massachusetts Institute of Technology.
+Copyright © 2008-2012 by the Massachusetts Institute of Technology.
+All rights reserved.
 
-  Permission to use, copy, modify, and distribute this software and
-  its documentation for any purpose and without fee is hereby granted,
-  provided that the above copyright notice appear in all copies and
-  that both that copyright notice and this permission notice appear in
-  supporting documentation, and that the name of M.I.T. not be used in
-  advertising or publicity pertaining to distribution of the software
-  without specific, written prior permission.  M.I.T. makes no
-  representations about the suitability of this software for any
-  purpose.  It is provided "as is" without express or implied
-  warranty.
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+    * Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above
+      copyright notice, this list of conditions and the following
+      disclaimer in the documentation and/or other materials provided
+      with the distribution.
+    * Neither the name of the Massachusetts Institute of Technology
+      nor the names of its contributors may be used to endorse or
+      promote products derived from this software without specific
+      prior written permission.
 
-The Debian packaging is Copyright © 2008 Massachusetts Institute of
-Technology, and has the same license as the original software.
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL MASSACHUSETTS
+INSTITUTE OF TECHNOLOGY BE LIABLE FOR ANY DIRECT, INDIRECT,
+INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
+OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
+USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGE.
+
+Caveat: The file "16killprocs-no-really" has additonal copyright
+holders and is licensed under the GPLv3.  See that file for complete
+copyright and license information.

Modified: trunk/debathena/config/reactivate/debian/debathena-reactivate.install
===================================================================
--- trunk/debathena/config/reactivate/debian/debathena-reactivate.install	2012-06-28 22:59:17 UTC (rev 25588)
+++ trunk/debathena/config/reactivate/debian/debathena-reactivate.install	2012-06-29 16:50:48 UTC (rev 25589)
@@ -15,3 +15,4 @@
 debian/reactivate usr/lib/debathena-reactivate
 debian/dbus-daemon-launch-helper lib/debathena-reactivate
 debian/90debathena-reactivate etc/schroot/setup.d
+debian/16killprocs-no-really etc/schroot/setup.d


home help back first fref pref prev next nref lref last post