#810145 pbuilder: find a way to umount /run/shm even if another process is accessing it

Package:
pbuilder
Source:
pbuilder
Submitter:
Sandro Tosi
Date:
2025-09-03 10:09:01 UTC
Severity:
normal
Tags:
#810145#5
Date:
2016-01-06 22:45:39 UTC
From:
To:
Hello,
when destroying the chroot, pbuilder umount run/shm, but if another process on
the system is accessing /run/shm then pbuilder keeps saying:

umount: /var/cache/pbuilder/build/11273/run/shm: target is busy
        (In some cases useful info about processes that
         use the device is found by lsof(8) or fuser(1).)

  This error only affects chroots; you may want to use
  user-mode-linux to avoid this message.


I would really prefer not to use u-m-l, so maybe you can consider other ways to
mount/umount /run/shm, like --bind-mount or --lazy umount, or any other
(better!) way to achieve the same result: dont error out if /run/shm is busy
when exiting the build env.

Thanks,
Sandro

#810145#12
Date:
2017-01-08 19:50:23 UTC
From:
To:
any update on this? the current behaviour is extremely annoying
#810145#17
Date:
2017-05-22 09:51:13 UTC
From:
To:
This is especially painful with the Jenkins Chroot plugin, which uses
`pbuilder execute` to run things - a stray process from a failed CI test
leads to gigs of "target is busy" messages in the build logs, which need
manually killing.

This doesn't seem inordinately difficult to resolve - lsof can filter on
BUILDPLACE, add a flag to kill stray processes, and just kill all the
detected processes when that's turned on

#810145#22
Date:
2017-06-05 12:19:59 UTC
From:
To:
tags 810145 patch

thanks


This works, IME - no more multi-gig Jenkins logs spamming "cannot umount" over and over for days



Sent from Outlook<http://aka.ms/weboutlook>

#810145#29
Date:
2017-06-05 20:24:16 UTC
From:
To:
Jo Shields dixit:

Umm…

BUILDPLACE=-q

BUILDPLACE=.foo

Passing a user-controlled argument to grep without escaping
it beforehand (and choosing a grep dialect, especially as
GNU grep does not default to BRE) or switching grep to fixed
strings is bad.

Something like this, maybe?

… | grep -F -e "$BUILDPLACE" | …

People seem to assume that writing ${foo} instead of $foo
escapes more, when it makes no difference in fact.

bye,
//mirabilos

#810145#34
Date:
2017-10-24 18:09:38 UTC
From:
To:
Any news on that /run/shm issue for pbuilder?  It is currently blocking me
from building packages as I can't upgrade my pbuilder tarball (as easily at
least).

I tried Jo's "proof of concept" patch, but no luck either.

Dirk

#810145#39
Date:
2017-10-25 11:16:29 UTC
From:
To:
I may have found the culprit. In my (rather old and carried forward from
prior versions) file /etc/pbuilderrc I still had

    BINDMOUNTS="/run/shm"

and commenting it out worked!  Yay.

Dirk

#810145#44
Date:
2018-01-23 04:26:31 UTC
From:
To:
I'm running 0.229 and i can confirm i no longer see this problem - thanks!
#810145#47
Date:
2018-01-23 11:52:32 UTC
From:
To:
I believe the situation improved a lot with 0.228 where we changed a
bunch of how SHM is mounted (especially the defaults).

But still if a process leaves zombie with an open fd somewhere it would
still stall, I think.

#810145#52
Date:
2025-09-03 10:07:30 UTC
From:
To:
Sent from my iPhone