~ubuntu-branches/ubuntu/trusty/schroot/trusty

« back to all changes in this revision

Viewing changes to etc/setup.d/15killprocs

  • Committer: Bazaar Package Importer
  • Author(s): Roger Leigh
  • Date: 2010-12-07 12:29:25 UTC
  • mfrom: (1.1.27 upstream) (2.2.18 sid)
  • Revision ID: james.westby@ubuntu.com-20101207122925-ks7yvl1ez1qzo8jz
* New upstream stable release.
* Document schroot -- option delimiter in schroot(1)
  (Closes: #599380).
* Document security implications of bind-mounting /dev and other
  filesystems in schroot.conf(5) (Closes: #587758).
* Relax chroot naming restrictions (Closes: #601043, #605939).  The
  name may not contain a leading period (‘.’).  The  characters ‘:’
  (colon), ‘,’ (comma) and ‘/’ (forward slash) are not permitted
  anywhere in the name.  The name may also not contain a trailing
  tilde ('~').  Otherwise any characters are permitted.
* 10mount: Respect mount options from configuration for all mountable
  chroot types (Closes: #605950).  Thanks to Nelson Elhage for this
  patch.
* 15killprocs: Improve performance by omitting a readlink call for
  each process running on the system, leading to a significant
  reduction in overhead on busy systems (Closes: #606162).  Thanks
  to Anders Kaseorg for this patch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
    info "Killing processes run inside $1"
41
41
    ls /proc | egrep '^[[:digit:]]+$' |
42
42
    while read pid; do
43
 
        root=$(readlink /proc/"$pid"/root || true)
44
 
        if [ "$root" = "$1" ]; then
 
43
        if [ /proc/"$pid"/root -ef "$1" ]; then
45
44
            exe=$(readlink /proc/"$pid"/exe || true)
46
45
            info "Killing left-over pid $pid (${exe##$1})"
47
46
            info "  Sending SIGTERM to pid $pid"