Package: psmisc
Version: 22.21-2

The "fuser" command does not print nothing about PID of processes that
keep busy a schroot's generated mount-point. Error messages when I
logout a schroot session:

~$ logout
E: 10mount: rmdir: failed to remove
'/var/lib/schroot/mount/kubuntu-a3ca1d7f-7fce-4673-b84a-6c4835bd7316':
Device or resource busy
E: kubuntu-a3ca1d7f-7fce-4673-b84a-6c4835bd7316: Chroot setup failed:
stage=setup-stop

Now I need to discover which PID keeps busy the directory:

~# fuser -m
/var/lib/schroot/mount/kubuntu-a3ca1d7f-7fce-4673-b84a-6c4835bd7316
/var/lib/schroot/mount/kubuntu-a3ca1d7f-7fce-4673-b84a-6c4835bd7316:
 1rce     2rce     3rce     5rce     7rce     8rce     9rce    10rce
11rce    12rce    13rce    15rce    16rce    17rce    18rce    20rce
21rce    22rce    23rce    25rce    26rce    27rce    28rce    30rce
31rce    32rce    33rce    35rce    36rce    37rce    38rce    40rce
41rce    42rce    43rce    44rce    45rce    46rce    47rce    48rce
49rce    50rce    51rce    52rce    53rce    54rce    55rce    56rce
58rce    59rce    60rce    61rce    67rce    68rce    69rce    70rce
73rce   115rce   116rce   117rce   123rce   124rce   125rce   126rce
127rce   128rce   129rce   130rce   131rce   132rce   133rce   134rce
136rce   139rce   140rce   141rce   142rce   143rce   146rce   147rce
155rce   156rce   157rce   158rce   159rce   160rce   161rce   162rce
163rce   165rce   169rce   175rce   176rce   177rce   190rce   191rce
197rce   198rce   220rce   221rce   252rce   254rce   260rce   262rce
267rce   269rce   310rce   342rce   426rce   428rce   435rce   482rce
488rce   494rce   499rce   500rce   502rce   503rce   505rce   506rce
508rce   509rce   511rce   513rce   536rce   537rce   691rce   694rce
701rce   724rce   725rce   726rce   776rce   788rce   801rce   862rce
871rce   899rce   903rce   904rce   909rce   911rce   912rce   914rce
946rce   949rce   950rce   989rce   990rce   993rce   995rce   998rce
1011rce  1046rce  1048rce  1049rce  1053rce  1060rce  1064rce  1079rce
1083rce  1288rce  1301rce  1302rce  1309rce  1333rce  1337rce  1338rce
1339rce  1342rce  1346rce  1368rce  1370rce  1375rce  1384rce  1396rce
1409rce  1418rce  1421rce  1422rce  1442rce  1443rce  1952rce  1953rce
2030rce  2034rce  2061rce  2138rce  2139rce
~# fuser /var/lib/schroot/mount/kubuntu-a3ca1d7f-7fce-4673-b84a-6c4835bd7316
~#

but nothing useful it's shown. The only way to find that PID is to
"grep" the mountinfo files into the /proc filesystem:

~$ grep -r a3ca1d7f /proc/*/mountinfo
/proc/2061/mountinfo:196 41 253:3 /
/var/lib/schroot/mount/kubuntu-a3ca1d7f-7fce-4673-b84a-6c4835bd7316
rw,relatime shared:135 - ext4 /dev/mapper/ld0-lv2 rw,stripe=256,data=ordered
/proc/2061/mountinfo:200 196 0:14 /
/var/lib/schroot/mount/kubuntu-a3ca1d7f-7fce-4673-b84a-6c4835bd7316/sys
rw,nosuid,nodev,noexec,relatime shared:137 master:7 - sysfs sysfs rw
/proc/2061/mountinfo:216 196 0:3 /
/var/lib/schroot/mount/kubuntu-a3ca1d7f-7fce-4673-b84a-6c4835bd7316/proc
rw,nosuid,nodev,noexec,relatime shared:151 master:12 - proc proc rw
/proc/2061/mountinfo:218 196 0:5 /
/var/lib/schroot/mount/kubuntu-a3ca1d7f-7fce-4673-b84a-6c4835bd7316/dev
rw,relatime shared:153 master:2 - devtmpfs udev
rw,size=10240k,nr_inodes=988768,mode=755
/proc/2061/mountinfo:223 196 0:15 /
/var/lib/schroot/mount/kubuntu-a3ca1d7f-7fce-4673-b84a-6c4835bd7316/run
rw,nosuid,relatime shared:158 master:5 - tmpfs tmpfs
rw,size=1585940k,mode=755
~$

So "2061" was the PID that I looked for. Why doesn't "fuser" find it?

******************************
* Details of the installation:
******************************

~$ uname -a
Linux itek 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt20-1+deb8u3
(2016-01-17) x86_64 GNU/Linux
~$ lsmod
Module                  Size  Used by
binfmt_misc            16949  1
pci_stub               12429  1
vboxpci                22921  0
vboxnetadp             25540  0
vboxnetflt             27648  0
vboxdrv               375525  3 vboxnetadp,vboxnetflt,vboxpci
kvm_amd                59128  0
kvm                   388784  1 kvm_amd
snd_usb_audio         135354  1
uvcvideo               79005  0
videobuf2_vmalloc      12816  1 uvcvideo
videobuf2_memops       12519  1 videobuf2_vmalloc
videobuf2_core         47787  1 uvcvideo
crc32_pclmul           12915  0
v4l2_common            12995  1 videobuf2_core
videodev              126451  3 uvcvideo,v4l2_common,videobuf2_core
snd_usbmidi_lib        23388  1 snd_usb_audio
media                  18305  2 uvcvideo,videodev
snd_rawmidi            26806  1 snd_usbmidi_lib
snd_seq_device         13132  1 snd_rawmidi
aesni_intel           151423  0
nvidia               8555095  53
snd_hda_codec_hdmi     45118  1
aes_x86_64             16719  1 aesni_intel
eeepc_wmi              12600  0
asus_wmi               22781  1 eeepc_wmi
sparse_keymap          12818  1 asus_wmi
lrw                    12757  1 aesni_intel
gf128mul               12970  1 lrw
snd_hda_codec_realtek    67127  1
snd_hda_codec_generic    63181  1 snd_hda_codec_realtek
rfkill                 18867  1 asus_wmi
video                  18096  1 asus_wmi
glue_helper            12695  1 aesni_intel
ablk_helper            12572  1 aesni_intel
snd_hda_intel          26327  6
mxm_wmi                12515  0
cryptd                 14516  2 aesni_intel,ablk_helper
snd_hda_controller     26646  1 snd_hda_intel
snd_hda_codec         104500  5
snd_hda_codec_realtek,snd_hda_codec_hdmi,snd_hda_codec_generic,snd_hda_intel,snd_hda_controller
fam15h_power           12684  0
evdev                  17445  22
pcspkr                 12595  0
serio_raw              12849  0
drm                   249955  3 nvidia
wmi                    17339  2 mxm_wmi,asus_wmi
k10temp                12618  0
tpm_infineon           16844  0
tpm_tis                17231  0
sp5100_tco             12864  0
i2c_piix4              20864  0
edac_mce_amd           21166  0
edac_core              51465  0
shpchp                 31121  0
snd_hwdep              13148  2 snd_usb_audio,snd_hda_codec
snd_pcm                88662  6
snd_usb_audio,snd_hda_codec_hdmi,snd_hda_codec,snd_hda_intel,snd_hda_controller
i2c_core               46012  5 drm,i2c_piix4,nvidia,v4l2_common,videodev
snd_timer              26614  1 snd_pcm
tpm                    31511  2 tpm_tis,tpm_infineon
acpi_cpufreq           17218  0
processor              28221  9 acpi_cpufreq
snd                    65244  25
snd_hda_codec_realtek,snd_usb_audio,snd_hwdep,snd_timer,snd_hda_codec_hdmi,snd_pcm,snd_rawmidi,snd_hda_codec_generic,snd_usbmidi_lib,snd_hda_codec,snd_hda_intel,snd_seq_device
button                 12944  0
soundcore              13026  2 snd,snd_hda_codec
thermal_sys            27642  2 video,processor
fuse                   83350  1
autofs4                35529  2
ext4                  473802  3
crc16                  12343  1 ext4
mbcache                17171  1 ext4
jbd2                   82522  1 ext4
dm_mod                 89405  17
raid456                77553  1
async_raid6_recov      16626  1 raid456
async_memcpy           12394  2 raid456,async_raid6_recov
async_pq               12561  2 raid456,async_raid6_recov
async_xor              12429  3 async_pq,raid456,async_raid6_recov
async_tx               12566  5
async_pq,raid456,async_xor,async_memcpy,async_raid6_recov
xor                    21040  1 async_xor
hid_generic            12393  0
usbhid                 44460  0
hid                   102264  2 hid_generic,usbhid
raid6_pq               95238  2 async_pq,async_raid6_recov
md_mod                107672  2 raid456
sg                     29973  0
sr_mod                 21903  0
sd_mod                 44356  8
cdrom                  47424  1 sr_mod
crc_t10dif             12431  1 sd_mod
crct10dif_generic      12581  0
ohci_pci               12808  0
crct10dif_pclmul       13387  1
crct10dif_common       12356  3
crct10dif_pclmul,crct10dif_generic,crc_t10dif
crc32c_intel           21809  0
ahci                   33334  4
libahci                27158  1 ahci
libata                177508  2 ahci,libahci
ohci_hcd               42982  1 ohci_pci
ehci_pci               12512  0
xhci_hcd              152977  0
ehci_hcd               69837  1 ehci_pci
usbcore               195427  9
snd_usb_audio,uvcvideo,ohci_hcd,ohci_pci,snd_usbmidi_lib,ehci_hcd,ehci_pci,usbhid,xhci_hcd
scsi_mod              191405  4 sg,libata,sd_mod,sr_mod
r8169                  68262  0
usb_common             12440  1 usbcore
mii                    12675  1 r8169

~$ cat /etc/debian_version
8.3

~$ inxi -F
System:    Host: itek Kernel: 3.16.0-4-amd64 x86_64 (64 bit) Desktop:
KDE 4.14.2
           Distro: Debian GNU/Linux 8
Machine:   Mobo: ASUSTeK model: M5A99X EVO R2.0 v: Rev 1.xx
           Bios: American Megatrends v: 2103 date: 11/07/2013
CPU:       Octa core AMD FX-8350 Eight-Core (-MCP-) cache: 16384 KB
           Clock Speeds: 1: 1400 MHz 2: 2800 MHz 3: 1400 MHz 4: 1400 MHz
5: 1400 MHz 6: 1400 MHz
           7: 1400 MHz 8: 1400 MHz
Graphics:  Card: NVIDIA GK208 [GeForce GT 630 Rev. 2]
           Display Server: X.Org 1.16.4 driver: nvidia Resolution:
1440x900@59.89hz
           GLX Renderer: GeForce GT 630/PCIe/SSE2 GLX Version: 4.5.0
NVIDIA 352.41
Audio:     Card-1 NVIDIA Device 0e0f driver: snd_hda_intel Sound: ALSA
v: k3.16.0-4-amd64
           Card-2 Advanced Micro Devices [AMD/ATI] SBx00 Azalia (Intel
HDA) driver: snd_hda_intel
           Card-3 Logitech Webcam C270 driver: USB Audio
Network:   Card: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet
Controller driver: r8169
           IF: eth0 state: up speed: 100 Mbps duplex: full mac:
e0:3f:49:14:29:89
Drives:    HDD Total Size: 4000.8GB (8.7% used) ID-1: /dev/sda model:
ST1000DM003 size: 1000.2GB
           ID-2: /dev/sdb model: ST1000DM003 size: 1000.2GB
           ID-3: /dev/sdc model: ST1000DM003 size: 1000.2GB
           ID-4: /dev/sdd model: ST1000DM003 size: 1000.2GB
Partition: ID-1: / size: 28G used: 7.3G (28%) fs: ext4 dev: /dev/dm-0
RAID:      Device-1: /dev/md0 - active raid: 5 components: online: 3/3 -
sdc1 sdb1 sda1 spare: sdd1
Sensors:   System Temperatures: cpu: 10.6C mobo: N/A gpu: 28C
           Fan Speeds (in rpm): cpu: N/A
Info:      Processes: 193 Uptime: 1:27 Memory: 1213.5/7743.8MB Client:
Shell (bash) inxi: 2.1.28

********************************************
* Some details of the schroot configuration:
********************************************

~$ cat /etc/schroot/desktop/fstab
# fstab: static file system information for chroots.
# Note that the mount point will be prefixed by the chroot path
# (CHROOT_PATH)
#
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
/sys            /sys            sysfs   rw,bind         0       0
/proc           /proc           proc    rw,bind         0       0
/dev            /dev            devtmpfs rw,bind         0       0
/dev/pts        /dev/pts        devpts  rw,bind         0       0
# /home           /home           none    rw,bind         0       0
# /tmp            /tmp            none    rw,bind         0       0

# If you use gdm3, uncomment this line to allow Xauth to work
#/var/run/gdm3  /var/run/gdm3   none    rw,bind         0       0
# For PulseAudio and other desktop-related things
#/var/lib/dbus    /var/lib/dbus  ext4    rw,bind         0       0

# It may be desirable to have access to /run, especially if you wish
# to run additional services in the chroot.  However, note that this
# may potentially cause undesirable behaviour on upgrades, such as
# killing services on the host.
/run           /run            tmpfs   rw,bind         0       0
/sys/kernel/security /sys/kernel/security securityfs rw,bind         0
     0
/dev/shm /dev/shm   tmpfs   rw,bind         0       0
/run/lock      /run/lock       tmpfs   rw,bind         0       0
# /run/shm       /run/shm        tmpfs   rw,bind         0       0
/sys/fs/cgroup/ /sys/fs/cgroup/ tmpfs   rw,bind         0       0
/sys/fs/cgroup/systemd /sys/fs/cgroup/systemd cgroup  rw,bind         0
      0
/sys/fs/pstore /sys/fs/pstore pstore  rw,bind         0       0
/sys/fs/cgroup/cpuset /sys/fs/cgroup/cpuset cgroup  rw,bind         0
    0
/sys/fs/cgroup/cpu,cpuacct /sys/fs/cgroup/cpu,cpuacct cgroup  rw,bind
      0       0
/sys/fs/cgroup/devices /sys/fs/cgroup/devices cgroup  rw,bind         0
      0
/sys/fs/cgroup/freezer /sys/fs/cgroup/freezer cgroup  rw,bind         0
      0
/sys/fs/cgroup/net_cls,net_prio /sys/fs/cgroup/net_cls,net_prio cgroup
rw,bind         0       0
/sys/fs/cgroup/blkio /sys/fs/cgroup/blkio cgroup  rw,bind         0       0
/sys/fs/cgroup/perf_event /sys/fs/cgroup/perf_event cgroup  rw,bind
    0       0
/proc/sys/fs/binfmt_misc /proc/sys/fs/binfmt_misc autofs  rw,bind
  0       0
/sys/kernel/debug /sys/kernel/debug debugfs  rw,bind         0       0
/dev/mqueue /dev/mqueue mqueue  rw,bind         0       0
/dev/hugepages /dev/hugepages hugetlbfs  rw,bind         0       0
# /sys/kernel/config /sys/kernel/config configfs rw,bind         0       0
# /sys/fs/fuse/connections /sys/fs/fuse/connections fusectl rw,bind
    0       0
# tmpfs /run/user/1000  tmpfs
rw,nosuid,nodev,relatime,size=792100k,mode=700,uid=1000,gid=1000
 0       0

~$ cat /etc/schroot/chroot.d/kubuntu.conf
[kubuntu]
description=Kubuntu 15.10
type=block-device
device=/dev/mapper/ld0-lv2
users=my-username
preserve-environment=false
environment-filter=XDG_RUNTIME_DIR
profile=desktop
setup.nssdatabases=
~$

***************************
* How to reproduce the bug:
***************************

Once configured schroot you can start a schroot session:

$ schroot -c kubuntu --
~$

Now open a new terminal and having cups already running as root type:

~# service cups restart
~#

then logout schroot's session (with errors):

~$ logout
E: 10mount: rmdir: failed to remove
'/var/lib/schroot/mount/kubuntu-d2c072e7-7e0c-4cfc-b48e-73defe8a4f0a':
Device or resource busy
E: kubuntu-d2c072e7-7e0c-4cfc-b48e-73defe8a4f0a: Chroot setup failed:
stage=setup-stop

Now fuser won't report cups as the process that keeps busy the
mount-point. Please note that maybe this issue affect also docker's
mount-point, I don't know, I never tried.
Thanks for your attenction, best regards.

-- 
Franco Martelli

Reply via email to