[buildd-tools-devel] Bug#841699: schroot: 15killprocs fails due to symlink /var/run/ -> /run/

Christoph Biedl debian.axhn at manchmal.in-ulm.de
Sat Oct 22 13:18:51 UTC 2016


Source: schroot
Version: 1.6.10-2+b1
Severity: normal
Tags: patch

Dear Maintainer,

after switching to overlay snapshotting (perhaps a coincidence) I
noticed *many* schroots are left behind since umount failed - which
was caused by the fact some processes were still running inside the
chroot.

Reproducer: Run "schroot --directory / <schroot-name>", execute
"sleep 3600 &" and "exit".

Long story short: The session's mount point is now under
/var/run/schroot/ while it used to be under /var/lib/schroot/.
However, /var/run is a symlink to /run, and

| if [ "$root" = "$1" ]; then
[ /etc/schroot/setup.d/15killprocs:55 ]

will fail since "$1" is schroot's view ("/var/run/...") while "$root"
(read from /proc) is the kernel's view with the symlink already
resolved ("/run/...").

Suggested fix, works for me:

--- a/etc/schroot/setup.d/15killprocs
+++ b/etc/schroot/setup.d/15killprocs
@@ -79,5 +79,5 @@ do_kill_all()
 }
 
 if [ $STAGE = "setup-recover" ] || [ $STAGE = "setup-stop" ]; then
-    do_kill_all "$CHROOT_PATH"
+    do_kill_all "$(readlink --canonicalize $CHROOT_PATH)"
 fi

Regards,

    Christoph

-- System Information:
Debian Release: stretch/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 4.4.24 (SMP w/4 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/dash
Init: unable to detect

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/buildd-tools-devel/attachments/20161022/dcc3b166/attachment.sig>


More information about the Buildd-tools-devel mailing list