Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 297423 - =sys-process/psmisc-22.9: fuser is buggy
Summary: =sys-process/psmisc-22.9: fuser is buggy
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo's Team for Core System packages
URL: https://sourceforge.net/tracker/?func...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-18 14:17 UTC by kouyu
Modified: 2010-01-04 12:54 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
openrc-0.5.3-fix-fuser-signals.patch (openrc-0.5.3-fix-fuser-signals.patch,359 bytes, patch)
2009-12-23 18:19 UTC, Lars Wendler (Polynomial-C) (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description kouyu 2009-12-18 14:17:54 UTC
Result of execute fuser in sys-process/psmisc-22.8:

$ fuser --help
Segmentation fault

$ fuser -TERM -k somefile
fuser: Invalid option T

The first error never happens to fuser-22.7.
The second error indicates fuser-22.8 doesn't recognize -NAME any more. Instead, it recognizes -SIGNAME only now.
And the second error causes /etc/init.d/localmount can not umount local filesystem, such as /usr, /home, when shutting down.
Why?
Because `/etc/init.d/localmount stop' calls do_unmount which is defined in /lib/rc/sh/rc-mount.sh. do_unmount uses fuser -TERM or fuser -KILL to kill processes before umount.
......
Comment 1 kouyu 2009-12-18 14:28:26 UTC
With fuser-22.7, I can umount /home and /usr when shutting down.
But with fuser-22.8, I can not.
Comment 2 SpanKY gentoo-dev 2009-12-18 16:02:26 UTC
i'm guessing psmisc-22.7 works fine for you ...

also, you need to post `emerge --info` in your bug reports
Comment 3 Samuli Suominen (RETIRED) gentoo-dev 2009-12-18 16:57:18 UTC
(In reply to comment #0)
> Result of execute fuser in sys-process/psmisc-22.8:
> 
> $ fuser --help
> Segmentation fault

This is http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=551833 which is fixed in upstream trunk. 

http://psmisc.cvs.sourceforge.net/viewvc/psmisc/psmisc/src/fuser.c?view=log#rev1.55

That said, it's `fuser -h` you should be using passing for help.
Comment 4 SpanKY gentoo-dev 2009-12-18 18:03:24 UTC
Samuli: so you going to add the change to the portage tree ?
Comment 5 kouyu 2009-12-19 06:17:16 UTC
SpanKY: yes, psmisc-22.7 works fine for me. I said, with psmisc-22.7, I can umount /usr and /home correctly when shutting down. But with psmisc-22.8, I can not. The reason is what I said, fuser can not accept -NAME as signal name but accept -SIGNAME only. You will know if you see /lib/rc/sh/rc-mount.sh.

Samuli: Yes, I should use 'fuser -h' to get help message. But to a application, if the given option is not valid, it should exit normally other than abort due to segmetation fault. Right? Fortunately, it is fixed :)  

But the second error (maybe not error, maybe an improvement) is important. Because do_unmount in /lib/rc/sh/rc-mount.sh should be changed due to this changing of fuser, shouldn't it?
Comment 6 Samuli Suominen (RETIRED) gentoo-dev 2009-12-23 15:15:24 UTC
(In reply to comment #4)
> Samuli: so you going to add the change to the portage tree ?
> 

I've committed fuser.h Rev 1.7 and fuser.c 1.59 (last changes 4 weeks ago) from upstream CVS as psmisc-22.8-r1. It fixes also missing "fuser -l" list signals command.

Still don't know about the fuser -TERM -k somefile bug(?) explained here...
Comment 7 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2009-12-23 18:19:36 UTC
Created attachment 213960 [details, diff]
openrc-0.5.3-fix-fuser-signals.patch

(In reply to comment #6)
> 
> Still don't know about the fuser -TERM -k somefile bug(?) explained here...
> 

Don't know if it's a bug but the implication on openrc's rc-mount.sh script is quite bad as is prevents unmounting of any partition that contains files which are still opened by some applications when shutdown or reboot was invoked. 
I used the attached patch in openrc to get a reliable rc-mount.sh script again with fuser from psmisc-22.8 but I don't know if this patch works with older versions of fuser too.
Comment 8 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2009-12-23 21:30:47 UTC
By the way, "pstree --help" segfaults as well.
Comment 9 Samuli Suominen (RETIRED) gentoo-dev 2009-12-23 22:15:26 UTC
Masked in tree, because of several regressions.

Both of the issues (pstree segfaulting and fuser -TERM -k issue) should be taken to upstream bug tracker, http://bugs.gentoo.org/show_bug.cgi?id=297423
Comment 10 Samuli Suominen (RETIRED) gentoo-dev 2009-12-23 22:16:04 UTC
(In reply to comment #9)
> taken to upstream bug tracker, http://bugs.gentoo.org/show_bug.cgi?id=297423

http://sourceforge.net/projects/psmisc/
Comment 11 Lars Wendler (Polynomial-C) (RETIRED) gentoo-dev 2010-01-01 22:30:06 UTC
psmisc-22.9 was released which fixed the segfaults. Unfortunately the fix which was added for the -TERM/-KILL problem doesn't work so I filed a bug about this problem in psmisc-22.9 (see URL).
Comment 12 Samuli Suominen (RETIRED) gentoo-dev 2010-01-02 10:56:21 UTC
(In reply to comment #11)
> psmisc-22.9 was released which fixed the segfaults. Unfortunately the fix which
> was added for the -TERM/-KILL problem doesn't work so I filed a bug about this
> problem in psmisc-22.9 (see URL).
> 

Thanks. I've moved 22.9 to tree, but it's still masked.
Comment 13 Samuli Suominen (RETIRED) gentoo-dev 2010-01-04 12:54:56 UTC
Fixed by psmisc-22.10.