On Fri, 29 Apr 2016 at 06:31, Franco Martelli <martelli...@gmail.com> wrote:

> $ fuser -M
> /var/lib/schroot/mount/kubuntu-e1c05063-2aca-491c-b5e4-4a4e1c41c65c
> Specified filename
> /var/lib/schroot/mount/kubuntu-e1c05063-2aca-491c-b5e4-4a4e1c41c65c is
> not a mountpoint.
>
> fuser now tell me that it wasn't a mount point but it was indeed,
> although actually not mounted anymore:
> $ mount | grep
> /var/lib/schroot/mount/kubuntu-e1c05063-2aca-491c-b5e4-4a4e1c41c65c
> $
>
Then fuser is doing the correct thing. If you specify that it should be
looking for a mount, and the mount is no longer there, then it will
correctly say it doesn't exist.

Most chroots are just directories, so they don't have their own mount point.

Also processes inside the chroot and outside the choot have a different
view of the world.

asking fuser which processes keeps busy the mount-point:
> # fuser
> /var/lib/schroot/mount/kubuntu-76da7862-ef1b-4b04-920b-459be3350e85/
> /var/lib/schroot/mount/kubuntu-76da7862-ef1b-4b04-920b-459be3350e85:  5681r
> # fuser -m
> /var/lib/schroot/mount/kubuntu-76da7862-ef1b-4b04-920b-459be3350e85/
> /var/lib/schroot/mount/kubuntu-76da7862-ef1b-4b04-920b-459be3350e85:
> 5681rce
> # fuser -M
> /var/lib/schroot/mount/kubuntu-76da7862-ef1b-4b04-920b-459be3350e85/
> /var/lib/schroot/mount/kubuntu-76da7862-ef1b-4b04-920b-459be3350e85:  5681r
>

So its doing the right thing here? It looks correct.

fuser never report cupsd's PID(5723) the 5681 PID number reported refers
> to bash:
> # pstree -cpan | grep -B2 -A1 5681
>   |   |-bash,1148 --rcfile ~/.bashrc_develop -i
>   |   |   `-schroot,5608 -c kubuntu --
>   |   |       `-bash,5681
>   |   `-bash,1152 --rcfile ~/.bashrc_develop -i
>

Can you provide:
 * what fuser command you are running
 * are you running this as root or not
 * Run sudo ls -l /proc/XXXX/{root,exe,cwd} where XXXX is the cups process
or whatever the one you think it is

e.g.
$  sudo fuser /srv/chroot/bullseye/
/srv/chroot/bullseye: 99201rc
$ sudo ls -l /proc/99201/{root,exe,cwd}
lrwxrwxrwx 1 root root 0 Dec 17 13:41 /proc/99201/cwd ->
/srv/chroot/bullseye
lrwxrwxrwx 1 root root 0 Dec 17 13:41 /proc/99201/exe ->
/srv/chroot/bullseye/usr/bin/bash
lrwxrwxrwx 1 root root 0 Dec 17 13:41 /proc/99201/root ->
/srv/chroot/bullseye





>
> HTH best regards
>
> On 25/04/2016 at 04:26, Craig Small wrote:
> > The problem is that fuser works off device numbers (it has to otherwise
> > symlinks would confuse it) and there is nothing much that makes the
> > chroots unique. A chroot is basically saying "start your tree here". My
> > chroots for example sit under /var/chroot
> >
> > Now, outside the chroot I can work out what process has that open with
> > fuser /var/chroot/wheezy (note the lack of -m because these are not
> > mount points).
> >
> > Remember when you use the -m command you are saying the device ID where
> > that file sits. It might be the actual mount point, or just a file (and
> > fuser works out where that file sits).
> >
> > If you really mean a mount point, then -M is a better idea.
> > I don't really understand your setup because you have other mounts
> > coming into your chroot. I think your tests are doing simple text
> > matching which causes a bunch of failed misses but need to be sure.
> >
> > /proc/<pid>/mountinfo isn't the fix, because just like /proc/<pid>/fd it
> > can be fooled by symlinks.
> >
> >  - Craig
> > --
> > Craig Small (@smallsees)   http://enc.com.au/       csmall at :
> > enc.com.au <http://enc.com.au>
> > Debian GNU/Linux           http://www.debian.org/   csmall at :
> > debian.org <http://debian.org>
> > GPG fingerprint:        5D2F B320 B825 D939 04D2  0519 3938 F96B DF50
> FEA5
>
> --
> Franco Martelli
>


-- 

Craig Small             https://dropbear.xyz/  csmall at : dropbear.xyz
Debian GNU/Linux        https://www.debian.org/
<http://www.debian.org/>  csmall at : debian.org
GPG fingerprint:     5D2F B320 B825 D939 04D2  0519 3938 F96B DF50 FEA5

Reply via email to