Bug 9247 - (int-158273) Busybox fuser command is non-functional
(int-158273)
: Busybox fuser command is non-functional
Status: RESOLVED FIXED
Product: Core
Busybox
: 5.0/(3.2010.02-8)
: N900 Maemo
: Unspecified normal with 4 votes (vote)
: Harmattan
Assigned To: Turo Janka
: busybox-bugs
:
: community-fremantle, patch, upstream
:
:
  Show dependency tree
 
Reported: 2010-02-24 00:25 UTC by Alan Bruce
Modified: 2010-11-22 17:13 UTC (History)
3 users (show)

See Also:


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


Description Alan Bruce (reporter) maemo.org 2010-02-24 00:25:39 UTC
SOFTWARE VERSION:
(Settings > General > About product)

EXACT STEPS LEADING TO PROBLEM: 

1. Run an application from a chroot
2. Attempt to use maemo 5 busybox fuser (fuser /chrootdir -k) to kill the app

EXPECTED OUTCOME:
All applications run within the chroot are killed.

ACTUAL OUTCOME:
Nothing happens. At all. All apps continue to run.

REPRODUCIBILITY:
always

EXTRA SOFTWARE INSTALLED:
Easy Chroot, Easy Debian + downloaded image (fast way to set up a test case)

OTHER COMMENTS:
http://talk.maemo.org/showthread.php?t=43912

If I copy the fuser binary from Debian and use it instead, all works as
expected. The fuser found in the psmisc package also works correctly, but the
psmisc package is not safe to install, since it uninstalls important core
packages.
Comment 1 Lucas Maneos 2010-02-24 09:58:57 UTC
Thanks for the report!

Steps to reproduce without chroot or extra software:
1. # lsof | grep -c /var/run/dbus/system_bus_socket
164
2. # fuser /var/run/dbus/system_bus_socket
(nothing)

Strace shows it just does the following (after lib initialisation etc):

stat64("/var/run/dbus/system_bus_socket", {st_mode=S_IFSOCK|0777, st_size=0,
...}) = 0
brk(0)                                  = 0x69000
brk(0x8a000)                            = 0x8a000
open(".", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY) = 3
fstat64(3, {st_mode=S_IFDIR|0755, st_size=2248, ...}) = 0
fcntl64(3, F_SETFD, FD_CLOEXEC)         = 0
getdents64(3, /* 31 entries */, 4096)   = 1040
getdents64(3, /* 0 entries */, 4096)    = 0
close(3)                                = 0
exit_group(1)                           = ?

That open("." ...) sure looks suspect.
Comment 2 Lucas Maneos 2010-02-24 10:03:08 UTC
Ah, apparently it was fixed in busybox 1.10.3.  Upstream patch:

<http://git.busybox.net/busybox/diff/procps/fuser.c?h=1_10_stable&id=49b78fc1a8f1591fa172399b3be1dba4b7f23554>
Comment 3 Eero Tamminen nokia 2010-03-01 11:58:20 UTC
Are there some upstream Debian packages that use & expect fuser to work
properly?

Or is fuser only used manually i.e. user can see that it doesn't work?

(wondering about the severity of this issue)
Comment 4 Lucas Maneos 2010-03-01 12:51:52 UTC
(In reply to comment #3)
> Are there some upstream Debian packages that use & expect fuser to work
> properly?

Not sure, but "apt-cache rdepends psmisc" doesn't show anything too important
(in Maemo context).

However Alan's Easy Debian project does require a working fuser, and it's
required by LSB anyway.  A quick grep shows that the postinst script of package
netbase is also using it, but that's probably not too serious (as Maemo updates
generally force a reboot).

Of course there are other ways of satisfying the requirement, such as bug 9266.
 But since there's a patch available (note: I haven't tested it) relative to
the exact version shipped with Fremantle patching/updating busybox sounds like
the easiest option.
Comment 5 Eero Tamminen nokia 2010-03-02 12:12:30 UTC
(In reply to comment #4)
>  But since there's a patch available (note: I haven't tested it) relative to
> the exact version shipped with Fremantle patching/updating busybox sounds like
> the easiest option.

The patch is fine, but at this phase mostly just bugs critical to end users
will be fixed for Fremantle (every change is a potential new bug etc).  It's a
bit late to get developer changes still in to Fremantle.

Easy Debian is for more advanced users (not normal end users) and I guess those
kind of users are able to re-install the metapackage themselves when needed
(which removes psmisc) so that they can do SSU?
Comment 6 Lucas Maneos 2010-03-02 12:38:18 UTC
(In reply to comment #5)
> The patch is fine, but at this phase mostly just bugs critical to end users
> will be fixed for Fremantle (every change is a potential new bug etc).  It's a
> bit late to get developer changes still in to Fremantle.

Well, in this case the fix is just a couple of lines (could even be shrunk down
to one) that don't affect anything else and fuser as shipped is broken anyway
so I vote for applying it.

Anyway, this probably isn't the right place to debate bugfix policies and if
this ends up being WONTFIX so be it.

In the meantime, the patch suggests a workaround: cd to /proc before calling
fuser.  Adjusting severity accordingly.
Comment 7 Alan Bruce (reporter) maemo.org 2010-03-03 02:31:00 UTC
Lucas, thank you for the workaround. Issuing a "cd /proc" before the fuser
command does indeed work. 

However, I also vote for the upstream patch to be applied. It feels so early
for "Fixed in Harmattan" to start appearing.
Comment 8 Andre Klapper maemo.org 2010-10-26 00:58:56 UTC
[Setting TM as fix has been submitted internally but not integrated in an
internal release]
Comment 9 Andre Klapper maemo.org 2010-11-22 17:13:13 UTC
This does not happen in Harmattan anymore (the version after Maemo5) which uses
Busybox 1.18, hence setting tentative Target Milestone to "Harmattan".
In case a fix for Maemo5 will be released (decision is up to Nokia) I will
reset the Target Milestone field to an earlier version than Harmattan.